/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'linkvisual.aliyuncs.com',
    ap-northeast-2-pop = 'linkvisual.aliyuncs.com',
    ap-south-1 = 'linkvisual.aliyuncs.com',
    ap-southeast-1 = 'linkvisual.aliyuncs.com',
    ap-southeast-2 = 'linkvisual.aliyuncs.com',
    ap-southeast-3 = 'linkvisual.aliyuncs.com',
    ap-southeast-5 = 'linkvisual.aliyuncs.com',
    cn-beijing = 'linkvisual.aliyuncs.com',
    cn-beijing-finance-1 = 'linkvisual.aliyuncs.com',
    cn-beijing-finance-pop = 'linkvisual.aliyuncs.com',
    cn-beijing-gov-1 = 'linkvisual.aliyuncs.com',
    cn-beijing-nu16-b01 = 'linkvisual.aliyuncs.com',
    cn-chengdu = 'linkvisual.aliyuncs.com',
    cn-edge-1 = 'linkvisual.aliyuncs.com',
    cn-fujian = 'linkvisual.aliyuncs.com',
    cn-haidian-cm12-c01 = 'linkvisual.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'linkvisual.aliyuncs.com',
    cn-hangzhou-finance = 'linkvisual.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'linkvisual.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'linkvisual.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'linkvisual.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'linkvisual.aliyuncs.com',
    cn-hangzhou-test-306 = 'linkvisual.aliyuncs.com',
    cn-hongkong = 'linkvisual.aliyuncs.com',
    cn-hongkong-finance-pop = 'linkvisual.aliyuncs.com',
    cn-huhehaote = 'linkvisual.aliyuncs.com',
    cn-north-2-gov-1 = 'linkvisual.aliyuncs.com',
    cn-qingdao = 'linkvisual.aliyuncs.com',
    cn-qingdao-nebula = 'linkvisual.aliyuncs.com',
    cn-shanghai-et15-b01 = 'linkvisual.aliyuncs.com',
    cn-shanghai-et2-b01 = 'linkvisual.aliyuncs.com',
    cn-shanghai-finance-1 = 'linkvisual.aliyuncs.com',
    cn-shanghai-inner = 'linkvisual.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'linkvisual.aliyuncs.com',
    cn-shenzhen = 'linkvisual.aliyuncs.com',
    cn-shenzhen-finance-1 = 'linkvisual.aliyuncs.com',
    cn-shenzhen-inner = 'linkvisual.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'linkvisual.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'linkvisual.aliyuncs.com',
    cn-wuhan = 'linkvisual.aliyuncs.com',
    cn-yushanfang = 'linkvisual.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'linkvisual.aliyuncs.com',
    cn-zhangjiakou = 'linkvisual.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'linkvisual.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'linkvisual.aliyuncs.com',
    eu-central-1 = 'linkvisual.aliyuncs.com',
    eu-west-1 = 'linkvisual.aliyuncs.com',
    eu-west-1-oxs = 'linkvisual.aliyuncs.com',
    me-east-1 = 'linkvisual.aliyuncs.com',
    rus-west-1-pop = 'linkvisual.aliyuncs.com',
    us-east-1 = 'linkvisual.aliyuncs.com',
    us-west-1 = 'linkvisual.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('linkvisual', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddEventRecordPlanDeviceRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model AddEventRecordPlanDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model AddEventRecordPlanDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEventRecordPlanDeviceResponseBody(name='body'),
}

async function addEventRecordPlanDeviceWithOptions(request: AddEventRecordPlanDeviceRequest, runtime: Util.RuntimeOptions): AddEventRecordPlanDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddEventRecordPlanDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addEventRecordPlanDevice(request: AddEventRecordPlanDeviceRequest): AddEventRecordPlanDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return addEventRecordPlanDeviceWithOptions(request, runtime);
}

model AddFaceDeviceGroupRequest {
  deviceGroupName?: string(name='DeviceGroupName', example='TestDeviceGroup'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
}

model AddFaceDeviceGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    deviceGroupId?: string(name='DeviceGroupId', example='jvkv****'),
    deviceGroupName?: string(name='DeviceGroupName', example='TestDeviceGroup'),
    modifiedTime?: string(name='ModifiedTime', example='2020-11-20 18:59:01'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='group already exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceDeviceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceDeviceGroupResponseBody(name='body'),
}

async function addFaceDeviceGroupWithOptions(request: AddFaceDeviceGroupRequest, runtime: Util.RuntimeOptions): AddFaceDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupName)) {
    query['DeviceGroupName'] = request.deviceGroupName;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceDeviceGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceDeviceGroup(request: AddFaceDeviceGroupRequest): AddFaceDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceDeviceGroupWithOptions(request, runtime);
}

model AddFaceDeviceToDeviceGroupRequest {
  deviceGroupId?: string(name='DeviceGroupId', example='kvjyhurc'),
  deviceName?: string(name='DeviceName', example='TestDevice'),
  iotInstanceId?: string(name='IotInstanceId', example='TestInstanceId'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  productKey?: string(name='ProductKey', example='a1Tp7KYZHHK'),
}

model AddFaceDeviceToDeviceGroupResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceDeviceToDeviceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceDeviceToDeviceGroupResponseBody(name='body'),
}

async function addFaceDeviceToDeviceGroupWithOptions(request: AddFaceDeviceToDeviceGroupRequest, runtime: Util.RuntimeOptions): AddFaceDeviceToDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceDeviceToDeviceGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceDeviceToDeviceGroup(request: AddFaceDeviceToDeviceGroupRequest): AddFaceDeviceToDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceDeviceToDeviceGroupWithOptions(request, runtime);
}

model AddFaceUserRequest {
  customUserId?: string(name='CustomUserId', example='1234567890'),
  facePicUrl?: string(name='FacePicUrl', example='https://example.com/test.jpeg'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  name?: string(name='Name', example='Tony'),
  params?: string(name='Params', example='{"key1":"value1", "key2":"value2"}'),
}

model AddFaceUserResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    customUserId?: string(name='CustomUserId', example='1234567890'),
    name?: string(name='Name', example='Tony'),
    params?: string(name='Params', example='{"key1":"value1", "key2":"value2"}'),
    userId?: string(name='UserId', example='3mtjaqebeq4d****'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='face user already exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceUserResponseBody(name='body'),
}

async function addFaceUserWithOptions(request: AddFaceUserRequest, runtime: Util.RuntimeOptions): AddFaceUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customUserId)) {
    query['CustomUserId'] = request.customUserId;
  }
  if (!Util.isUnset(request.facePicUrl)) {
    query['FacePicUrl'] = request.facePicUrl;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.params)) {
    query['Params'] = request.params;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceUser',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceUser(request: AddFaceUserRequest): AddFaceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceUserWithOptions(request, runtime);
}

model AddFaceUserGroupRequest {
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  userGroupName?: string(name='UserGroupName', example='TestUserGroup'),
}

model AddFaceUserGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    modifiedTime?: string(name='ModifiedTime', example='2020-11-20 18:59:01'),
    userGroupId?: string(name='UserGroupId', example='kvjy****'),
    userGroupName?: string(name='UserGroupName', example='TestUserGroup'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='group already exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceUserGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceUserGroupResponseBody(name='body'),
}

async function addFaceUserGroupWithOptions(request: AddFaceUserGroupRequest, runtime: Util.RuntimeOptions): AddFaceUserGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userGroupName)) {
    query['UserGroupName'] = request.userGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceUserGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceUserGroup(request: AddFaceUserGroupRequest): AddFaceUserGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceUserGroupWithOptions(request, runtime);
}

model AddFaceUserGroupAndDeviceGroupRelationRequest {
  deviceGroupId?: string(name='DeviceGroupId', example='kvjyhurc'),
  iotInstanceId?: string(name='IotInstanceId', example='TestInstanceId'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  relation?: string(name='Relation', example='SYNC_INFO_PICTURE'),
  userGroupId?: string(name='UserGroupId', example='avjyxurd'),
}

model AddFaceUserGroupAndDeviceGroupRelationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    controlId?: string(name='ControlId', example='qcb2yea4ha4dxmly'),
    modifiedTime?: string(name='ModifiedTime', example='2020-11-20 18:59:01'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceUserGroupAndDeviceGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceUserGroupAndDeviceGroupRelationResponseBody(name='body'),
}

async function addFaceUserGroupAndDeviceGroupRelationWithOptions(request: AddFaceUserGroupAndDeviceGroupRelationRequest, runtime: Util.RuntimeOptions): AddFaceUserGroupAndDeviceGroupRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.relation)) {
    query['Relation'] = request.relation;
  }
  if (!Util.isUnset(request.userGroupId)) {
    query['UserGroupId'] = request.userGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceUserGroupAndDeviceGroupRelation',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceUserGroupAndDeviceGroupRelation(request: AddFaceUserGroupAndDeviceGroupRelationRequest): AddFaceUserGroupAndDeviceGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceUserGroupAndDeviceGroupRelationWithOptions(request, runtime);
}

model AddFaceUserPictureRequest {
  facePicUrl?: string(name='FacePicUrl', example='https://example.com/test.jpeg'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  userId?: string(name='UserId', example='3mtjaqebeq4d****'),
}

model AddFaceUserPictureResponseBody = {
  code?: string(name='Code', example='200'),
  data?: map[string]any(name='Data', example='1bb580ef7****'),
  errorMessage?: string(name='ErrorMessage', example='face user not exist'),
  requestId?: string(name='RequestId', example='4de2c367-c1db-417c-aa15-8c585e595d92'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceUserPictureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceUserPictureResponseBody(name='body'),
}

async function addFaceUserPictureWithOptions(request: AddFaceUserPictureRequest, runtime: Util.RuntimeOptions): AddFaceUserPictureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.facePicUrl)) {
    query['FacePicUrl'] = request.facePicUrl;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceUserPicture',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceUserPicture(request: AddFaceUserPictureRequest): AddFaceUserPictureResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceUserPictureWithOptions(request, runtime);
}

model AddFaceUserToUserGroupRequest {
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  userGroupId?: string(name='UserGroupId', example='kvjy****'),
  userId?: string(name='UserId', example='3mtjaqebeq4d****'),
}

model AddFaceUserToUserGroupResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='face user not exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model AddFaceUserToUserGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFaceUserToUserGroupResponseBody(name='body'),
}

async function addFaceUserToUserGroupWithOptions(request: AddFaceUserToUserGroupRequest, runtime: Util.RuntimeOptions): AddFaceUserToUserGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userGroupId)) {
    query['UserGroupId'] = request.userGroupId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddFaceUserToUserGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addFaceUserToUserGroup(request: AddFaceUserToUserGroupRequest): AddFaceUserToUserGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addFaceUserToUserGroupWithOptions(request, runtime);
}

model AddRecordPlanDeviceRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model AddRecordPlanDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model AddRecordPlanDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddRecordPlanDeviceResponseBody(name='body'),
}

async function addRecordPlanDeviceWithOptions(request: AddRecordPlanDeviceRequest, runtime: Util.RuntimeOptions): AddRecordPlanDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddRecordPlanDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addRecordPlanDevice(request: AddRecordPlanDeviceRequest): AddRecordPlanDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return addRecordPlanDeviceWithOptions(request, runtime);
}

model BatchQueryVisionDeviceInfoRequest {
  deviceNameList?: [ string ](name='DeviceNameList'),
  iotIdList?: [ string ](name='IotIdList'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model BatchQueryVisionDeviceInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    deviceInfoList?: [ 
      {
        description?: string(name='Description'),
        deviceType?: int32(name='DeviceType'),
        gbDeviceInfo?: {
          deviceProtocol?: int32(name='DeviceProtocol'),
          gbId?: string(name='GbId'),
          netProtocol?: int32(name='NetProtocol'),
          nickName?: string(name='NickName'),
          password?: string(name='Password'),
          subProductKey?: string(name='SubProductKey'),
        }(name='GbDeviceInfo'),
        iotId?: string(name='IotId'),
        rtmpDeviceInfo?: {
          pullAuthKey?: string(name='PullAuthKey'),
          pullKeyExpireTime?: int32(name='PullKeyExpireTime'),
          pushAuthKey?: string(name='PushAuthKey'),
          pushKeyExpireTime?: int32(name='PushKeyExpireTime'),
          pushUrlSample?: string(name='PushUrlSample'),
          streamName?: string(name='StreamName'),
          streamStatus?: int32(name='StreamStatus'),
        }(name='RtmpDeviceInfo'),
      }
    ](name='DeviceInfoList'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model BatchQueryVisionDeviceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchQueryVisionDeviceInfoResponseBody(name='body'),
}

async function batchQueryVisionDeviceInfoWithOptions(request: BatchQueryVisionDeviceInfoRequest, runtime: Util.RuntimeOptions): BatchQueryVisionDeviceInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceNameList)) {
    query['DeviceNameList'] = request.deviceNameList;
  }
  if (!Util.isUnset(request.iotIdList)) {
    query['IotIdList'] = request.iotIdList;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchQueryVisionDeviceInfo',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchQueryVisionDeviceInfo(request: BatchQueryVisionDeviceInfoRequest): BatchQueryVisionDeviceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchQueryVisionDeviceInfoWithOptions(request, runtime);
}

model BindPictureSearchAppWithDevicesRequest {
  appInstanceId?: string(name='AppInstanceId', example='5a502d3fbab8410e8fd4be9037c7****'),
  deviceIotIds?: [ string ](name='DeviceIotIds', example='VrJwPGjC1sJlqPjZA3cxg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-060a****'),
}

model BindPictureSearchAppWithDevicesResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='iotIdList is error'),
  requestId?: string(name='RequestId', example='B8A4153B-4F18-49B1-90C0-C9194866FF88'),
  success?: boolean(name='Success', example='true'),
}

model BindPictureSearchAppWithDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindPictureSearchAppWithDevicesResponseBody(name='body'),
}

async function bindPictureSearchAppWithDevicesWithOptions(request: BindPictureSearchAppWithDevicesRequest, runtime: Util.RuntimeOptions): BindPictureSearchAppWithDevicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.deviceIotIds)) {
    query['DeviceIotIds'] = request.deviceIotIds;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindPictureSearchAppWithDevices',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindPictureSearchAppWithDevices(request: BindPictureSearchAppWithDevicesRequest): BindPictureSearchAppWithDevicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindPictureSearchAppWithDevicesWithOptions(request, runtime);
}

model CheckFaceUserDoExistOnDeviceRequest {
  deviceName?: string(name='DeviceName', example='TestDeviceName'),
  iotInstanceId?: string(name='IotInstanceId', example='TestIotInstanceId'),
  isolationId?: string(name='IsolationId', example='a103lZ86ovStDMnU'),
  productKey?: string(name='ProductKey', example='a1654Sr4Y3f'),
  userId?: string(name='UserId', example='tibce3fsgqelezk8'),
}

model CheckFaceUserDoExistOnDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    doExist?: boolean(name='DoExist', example='true'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model CheckFaceUserDoExistOnDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckFaceUserDoExistOnDeviceResponseBody(name='body'),
}

async function checkFaceUserDoExistOnDeviceWithOptions(request: CheckFaceUserDoExistOnDeviceRequest, runtime: Util.RuntimeOptions): CheckFaceUserDoExistOnDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckFaceUserDoExistOnDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkFaceUserDoExistOnDevice(request: CheckFaceUserDoExistOnDeviceRequest): CheckFaceUserDoExistOnDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkFaceUserDoExistOnDeviceWithOptions(request, runtime);
}

model ClearFaceDeviceDBRequest {
  deviceName?: string(name='DeviceName', example='TestDevice_1'),
  iotInstanceId?: string(name='IotInstanceId', example='iot_instc_pu****_c*-v64********'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  productKey?: string(name='ProductKey', example='a1Wmy******'),
}

model ClearFaceDeviceDBResponseBody = {
  code?: string(name='Code', example='200'),
  data?: map[string]any(name='Data', example='""'),
  errorMessage?: string(name='ErrorMessage', example='device not found'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model ClearFaceDeviceDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ClearFaceDeviceDBResponseBody(name='body'),
}

async function clearFaceDeviceDBWithOptions(request: ClearFaceDeviceDBRequest, runtime: Util.RuntimeOptions): ClearFaceDeviceDBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClearFaceDeviceDB',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clearFaceDeviceDB(request: ClearFaceDeviceDBRequest): ClearFaceDeviceDBResponse {
  var runtime = new Util.RuntimeOptions{};
  return clearFaceDeviceDBWithOptions(request, runtime);
}

model CreateEventRecordPlanRequest {
  eventTypes?: string(name='EventTypes', example='1'),
  name?: string(name='Name', example='plan1'),
  preRecordDuration?: int32(name='PreRecordDuration', example='5'),
  recordDuration?: int32(name='RecordDuration', example='10'),
  templateId?: string(name='TemplateId', example='fc82774fa749485bad7d719f9670****'),
}

model CreateEventRecordPlanResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='fc82774fa749485bad7d719f9670****'),
  errorMessage?: string(name='ErrorMessage', example='product is not active.'),
  requestId?: string(name='RequestId', example='a195f615-8c64-4cc6-af57-2f42c6cca15c'),
  success?: boolean(name='Success', example='true'),
}

model CreateEventRecordPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEventRecordPlanResponseBody(name='body'),
}

async function createEventRecordPlanWithOptions(request: CreateEventRecordPlanRequest, runtime: Util.RuntimeOptions): CreateEventRecordPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eventTypes)) {
    query['EventTypes'] = request.eventTypes;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.preRecordDuration)) {
    query['PreRecordDuration'] = request.preRecordDuration;
  }
  if (!Util.isUnset(request.recordDuration)) {
    query['RecordDuration'] = request.recordDuration;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateEventRecordPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createEventRecordPlan(request: CreateEventRecordPlanRequest): CreateEventRecordPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createEventRecordPlanWithOptions(request, runtime);
}

model CreateGbDeviceRequest {
  description?: string(name='Description'),
  deviceName?: string(name='DeviceName'),
  deviceType?: int32(name='DeviceType'),
  gbId?: string(name='GbId'),
  iotInstanceId?: string(name='IotInstanceId'),
  mediaNetProtocol?: string(name='MediaNetProtocol'),
  password?: string(name='Password'),
  productKey?: string(name='ProductKey'),
  subProductKey?: string(name='SubProductKey'),
}

model CreateGbDeviceResponseBody = {
  code?: string(name='Code'),
  data?: {
    deviceName?: string(name='DeviceName'),
    iotId?: string(name='IotId'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateGbDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGbDeviceResponseBody(name='body'),
}

async function createGbDeviceWithOptions(request: CreateGbDeviceRequest, runtime: Util.RuntimeOptions): CreateGbDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.deviceType)) {
    query['DeviceType'] = request.deviceType;
  }
  if (!Util.isUnset(request.gbId)) {
    query['GbId'] = request.gbId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.mediaNetProtocol)) {
    query['MediaNetProtocol'] = request.mediaNetProtocol;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.subProductKey)) {
    query['SubProductKey'] = request.subProductKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGbDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createGbDevice(request: CreateGbDeviceRequest): CreateGbDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGbDeviceWithOptions(request, runtime);
}

model CreateLocalFileUploadJobRequest {
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  timeSlot?: [ 
    {
      deviceName?: string(name='DeviceName', example='camera1'),
      endTime?: int32(name='EndTime', example='1631019775'),
      iotId?: string(name='IotId', example='d7XmBoJhAr88C6PelXDF00****'),
      productKey?: string(name='ProductKey', example='a1BwAGV****'),
      startTime?: int32(name='StartTime', example='1631019675'),
    }
  ](name='TimeSlot'),
}

model CreateLocalFileUploadJobResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    jobId?: string(name='JobId', example='1ec1a2****d0435fbc0****34f6f139d'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='InvalidParameter'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model CreateLocalFileUploadJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLocalFileUploadJobResponseBody(name='body'),
}

async function createLocalFileUploadJobWithOptions(request: CreateLocalFileUploadJobRequest, runtime: Util.RuntimeOptions): CreateLocalFileUploadJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.timeSlot)) {
    query['TimeSlot'] = request.timeSlot;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLocalFileUploadJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createLocalFileUploadJob(request: CreateLocalFileUploadJobRequest): CreateLocalFileUploadJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLocalFileUploadJobWithOptions(request, runtime);
}

model CreateLocalRecordDownloadByTimeJobRequest {
  beginTime?: int32(name='BeginTime', example='1900000000'),
  deviceName?: string(name='DeviceName', example='Device01'),
  endTime?: int32(name='EndTime', example='2100000000'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-******'),
  productKey?: string(name='ProductKey', example='a1Bw******'),
  speed?: float(name='Speed', example='1.0'),
}

model CreateLocalRecordDownloadByTimeJobResponseBody = {
  code?: string(name='Code', example='400'),
  data?: {
    jobId?: string(name='JobId', example='w2s******'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Download job error.'),
  requestId?: string(name='RequestId', example='E55***B7-4***-4***-8***-D3******F565'),
  success?: boolean(name='Success', example='true'),
}

model CreateLocalRecordDownloadByTimeJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLocalRecordDownloadByTimeJobResponseBody(name='body'),
}

async function createLocalRecordDownloadByTimeJobWithOptions(request: CreateLocalRecordDownloadByTimeJobRequest, runtime: Util.RuntimeOptions): CreateLocalRecordDownloadByTimeJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLocalRecordDownloadByTimeJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createLocalRecordDownloadByTimeJob(request: CreateLocalRecordDownloadByTimeJobRequest): CreateLocalRecordDownloadByTimeJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLocalRecordDownloadByTimeJobWithOptions(request, runtime);
}

model CreatePictureSearchAppRequest {
  desc?: string(name='Desc'),
  iotInstanceId?: string(name='IotInstanceId', example='iot_instc_pu****_c*-v64********'),
  name?: string(name='Name'),
}

model CreatePictureSearchAppResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='5a502d3fbab8410e8fd4be9037c7****'),
  errorMessage?: string(name='ErrorMessage', example='Name is mandatory for this action.'),
  requestId?: string(name='RequestId', example='3A754C90-1286-4C2C-A3BA-8BF5BAD4BF76'),
  success?: boolean(name='Success', example='true'),
}

model CreatePictureSearchAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePictureSearchAppResponseBody(name='body'),
}

async function createPictureSearchAppWithOptions(request: CreatePictureSearchAppRequest, runtime: Util.RuntimeOptions): CreatePictureSearchAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.desc)) {
    query['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePictureSearchApp',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createPictureSearchApp(request: CreatePictureSearchAppRequest): CreatePictureSearchAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPictureSearchAppWithOptions(request, runtime);
}

model CreatePictureSearchJobRequest {
  appInstanceId?: string(name='AppInstanceId', example='3e429560124b44b685095df81a27****'),
  bodyThreshold?: float(name='BodyThreshold', example='0.9'),
  endTime?: long(name='EndTime', example='1614327915000'),
  pictureSearchType?: int32(name='PictureSearchType', example='1'),
  searchPicUrl?: string(name='SearchPicUrl', example='http://xxx.xxx/1.jpg'),
  startTime?: long(name='StartTime', example='1614227915000'),
  threshold?: float(name='Threshold', example='0.5'),
}

model CreatePictureSearchJobResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='71632df011294a85910c566e7181****'),
  errorMessage?: string(name='ErrorMessage', example='The request has failed due to a temporary failure of the server.'),
  requestId?: string(name='RequestId', example='FAEBE068-07DE-4B88-AC2A-51FC2B556211'),
  success?: boolean(name='Success', example='true'),
}

model CreatePictureSearchJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePictureSearchJobResponseBody(name='body'),
}

async function createPictureSearchJobWithOptions(request: CreatePictureSearchJobRequest, runtime: Util.RuntimeOptions): CreatePictureSearchJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.bodyThreshold)) {
    query['BodyThreshold'] = request.bodyThreshold;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pictureSearchType)) {
    query['PictureSearchType'] = request.pictureSearchType;
  }
  if (!Util.isUnset(request.searchPicUrl)) {
    query['SearchPicUrl'] = request.searchPicUrl;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePictureSearchJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createPictureSearchJob(request: CreatePictureSearchJobRequest): CreatePictureSearchJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPictureSearchJobWithOptions(request, runtime);
}

model CreateRecordDownloadByTimeJobRequest {
  beginTime?: int32(name='BeginTime', example='1900000000'),
  deviceName?: string(name='DeviceName', example='Device01'),
  endTime?: int32(name='EndTime', example='2100000000'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-******'),
  productKey?: string(name='ProductKey', example='a1Bw******'),
  recordType?: int32(name='RecordType', example='0'),
  streamType?: int32(name='StreamType', example='0'),
}

model CreateRecordDownloadByTimeJobResponseBody = {
  code?: string(name='Code', example='400'),
  data?: {
    jobId?: string(name='JobId', example='w2s******'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Record not exist.'),
  requestId?: string(name='RequestId', example='E55***B7-4***-4***-8***-D3******F565'),
  success?: boolean(name='Success', example='true'),
}

model CreateRecordDownloadByTimeJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRecordDownloadByTimeJobResponseBody(name='body'),
}

async function createRecordDownloadByTimeJobWithOptions(request: CreateRecordDownloadByTimeJobRequest, runtime: Util.RuntimeOptions): CreateRecordDownloadByTimeJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.recordType)) {
    query['RecordType'] = request.recordType;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRecordDownloadByTimeJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRecordDownloadByTimeJob(request: CreateRecordDownloadByTimeJobRequest): CreateRecordDownloadByTimeJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRecordDownloadByTimeJobWithOptions(request, runtime);
}

model CreateRecordPlanRequest {
  name?: string(name='Name', example='plan1'),
  templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
}

model CreateRecordPlanResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='5b60bf0dd55944c19d7817442bc9****'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model CreateRecordPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRecordPlanResponseBody(name='body'),
}

async function createRecordPlanWithOptions(request: CreateRecordPlanRequest, runtime: Util.RuntimeOptions): CreateRecordPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRecordPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRecordPlan(request: CreateRecordPlanRequest): CreateRecordPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRecordPlanWithOptions(request, runtime);
}

model CreateRtmpDeviceRequest {
  description?: string(name='Description'),
  deviceName?: string(name='DeviceName'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
  pullAuthKey?: string(name='PullAuthKey'),
  pullKeyExpireTime?: int32(name='PullKeyExpireTime'),
  pushAuthKey?: string(name='PushAuthKey'),
  pushKeyExpireTime?: int32(name='PushKeyExpireTime'),
  subStreamName?: string(name='SubStreamName'),
}

model CreateRtmpDeviceResponseBody = {
  code?: string(name='Code'),
  data?: {
    deviceName?: string(name='DeviceName'),
    iotId?: string(name='IotId'),
    streamName?: string(name='StreamName'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateRtmpDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRtmpDeviceResponseBody(name='body'),
}

async function createRtmpDeviceWithOptions(request: CreateRtmpDeviceRequest, runtime: Util.RuntimeOptions): CreateRtmpDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.pullAuthKey)) {
    query['PullAuthKey'] = request.pullAuthKey;
  }
  if (!Util.isUnset(request.pullKeyExpireTime)) {
    query['PullKeyExpireTime'] = request.pullKeyExpireTime;
  }
  if (!Util.isUnset(request.pushAuthKey)) {
    query['PushAuthKey'] = request.pushAuthKey;
  }
  if (!Util.isUnset(request.pushKeyExpireTime)) {
    query['PushKeyExpireTime'] = request.pushKeyExpireTime;
  }
  if (!Util.isUnset(request.subStreamName)) {
    query['SubStreamName'] = request.subStreamName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRtmpDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRtmpDevice(request: CreateRtmpDeviceRequest): CreateRtmpDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRtmpDeviceWithOptions(request, runtime);
}

model CreateStreamPushJobRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  jobType?: int32(name='JobType'),
  productKey?: string(name='ProductKey'),
  pushUrl?: string(name='PushUrl'),
  streamType?: int32(name='StreamType'),
}

model CreateStreamPushJobResponseBody = {
  code?: string(name='Code'),
  data?: {
    jobId?: string(name='JobId'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateStreamPushJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateStreamPushJobResponseBody(name='body'),
}

async function createStreamPushJobWithOptions(request: CreateStreamPushJobRequest, runtime: Util.RuntimeOptions): CreateStreamPushJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobType)) {
    query['JobType'] = request.jobType;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.pushUrl)) {
    query['PushUrl'] = request.pushUrl;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateStreamPushJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createStreamPushJob(request: CreateStreamPushJobRequest): CreateStreamPushJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createStreamPushJobWithOptions(request, runtime);
}

model CreateStreamSnapshotJobRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
  snapshotInterval?: int32(name='SnapshotInterval'),
  streamType?: int32(name='StreamType'),
}

model CreateStreamSnapshotJobResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateStreamSnapshotJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateStreamSnapshotJobResponseBody(name='body'),
}

async function createStreamSnapshotJobWithOptions(request: CreateStreamSnapshotJobRequest, runtime: Util.RuntimeOptions): CreateStreamSnapshotJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.snapshotInterval)) {
    query['SnapshotInterval'] = request.snapshotInterval;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateStreamSnapshotJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createStreamSnapshotJob(request: CreateStreamSnapshotJobRequest): CreateStreamSnapshotJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createStreamSnapshotJobWithOptions(request, runtime);
}

model CreateTimeTemplateRequest {
  allDay?: int32(name='AllDay', example='0'),
  name?: string(name='Name', example='example'),
  timeSections?: [ 
    {
      begin?: int32(name='Begin', example='20000'),
      dayOfWeek?: int32(name='DayOfWeek', example='0'),
      end?: int32(name='End', example='60000'),
    }
  ](name='TimeSections'),
}

model CreateTimeTemplateResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='38c94f874f2e4ce3b4b6da36****5213'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model CreateTimeTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTimeTemplateResponseBody(name='body'),
}

async function createTimeTemplateWithOptions(request: CreateTimeTemplateRequest, runtime: Util.RuntimeOptions): CreateTimeTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allDay)) {
    query['AllDay'] = request.allDay;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.timeSections)) {
    query['TimeSections'] = request.timeSections;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTimeTemplate',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTimeTemplate(request: CreateTimeTemplateRequest): CreateTimeTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTimeTemplateWithOptions(request, runtime);
}

model DeleteEventRecordPlanRequest {
  planId?: string(name='PlanId', example='2e34a1989aa54debac22358aca7f****'),
}

model DeleteEventRecordPlanResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='438A20F2-AFF2-4CAC-89F9-3378EAA133BD'),
  success?: boolean(name='Success', example='true'),
}

model DeleteEventRecordPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEventRecordPlanResponseBody(name='body'),
}

async function deleteEventRecordPlanWithOptions(request: DeleteEventRecordPlanRequest, runtime: Util.RuntimeOptions): DeleteEventRecordPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEventRecordPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEventRecordPlan(request: DeleteEventRecordPlanRequest): DeleteEventRecordPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEventRecordPlanWithOptions(request, runtime);
}

model DeleteEventRecordPlanDeviceRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model DeleteEventRecordPlanDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model DeleteEventRecordPlanDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEventRecordPlanDeviceResponseBody(name='body'),
}

async function deleteEventRecordPlanDeviceWithOptions(request: DeleteEventRecordPlanDeviceRequest, runtime: Util.RuntimeOptions): DeleteEventRecordPlanDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEventRecordPlanDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEventRecordPlanDevice(request: DeleteEventRecordPlanDeviceRequest): DeleteEventRecordPlanDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEventRecordPlanDeviceWithOptions(request, runtime);
}

model DeleteFaceDeviceGroupRequest {
  deviceGroupId?: string(name='DeviceGroupId', example='qaf2tihq'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
}

model DeleteFaceDeviceGroupResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model DeleteFaceDeviceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaceDeviceGroupResponseBody(name='body'),
}

async function deleteFaceDeviceGroupWithOptions(request: DeleteFaceDeviceGroupRequest, runtime: Util.RuntimeOptions): DeleteFaceDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFaceDeviceGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFaceDeviceGroup(request: DeleteFaceDeviceGroupRequest): DeleteFaceDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceDeviceGroupWithOptions(request, runtime);
}

model DeleteFaceUserRequest {
  isolationId?: string(name='IsolationId', example='ZheJiangHzXiHu'),
  userId?: string(name='UserId', example='3mtjaqebeq4dulcy'),
}

model DeleteFaceUserResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model DeleteFaceUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaceUserResponseBody(name='body'),
}

async function deleteFaceUserWithOptions(request: DeleteFaceUserRequest, runtime: Util.RuntimeOptions): DeleteFaceUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFaceUser',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFaceUser(request: DeleteFaceUserRequest): DeleteFaceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceUserWithOptions(request, runtime);
}

model DeleteFaceUserGroupRequest {
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  userGroupId?: string(name='UserGroupId', example='kvjy****'),
}

model DeleteFaceUserGroupResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='face group not exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model DeleteFaceUserGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaceUserGroupResponseBody(name='body'),
}

async function deleteFaceUserGroupWithOptions(request: DeleteFaceUserGroupRequest, runtime: Util.RuntimeOptions): DeleteFaceUserGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userGroupId)) {
    query['UserGroupId'] = request.userGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFaceUserGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFaceUserGroup(request: DeleteFaceUserGroupRequest): DeleteFaceUserGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceUserGroupWithOptions(request, runtime);
}

model DeleteFaceUserGroupAndDeviceGroupRelationRequest {
  controlId?: string(name='ControlId', example='qcb2yea4ha4d****'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
}

model DeleteFaceUserGroupAndDeviceGroupRelationResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='access control not exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model DeleteFaceUserGroupAndDeviceGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaceUserGroupAndDeviceGroupRelationResponseBody(name='body'),
}

async function deleteFaceUserGroupAndDeviceGroupRelationWithOptions(request: DeleteFaceUserGroupAndDeviceGroupRelationRequest, runtime: Util.RuntimeOptions): DeleteFaceUserGroupAndDeviceGroupRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.controlId)) {
    query['ControlId'] = request.controlId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFaceUserGroupAndDeviceGroupRelation',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFaceUserGroupAndDeviceGroupRelation(request: DeleteFaceUserGroupAndDeviceGroupRelationRequest): DeleteFaceUserGroupAndDeviceGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceUserGroupAndDeviceGroupRelationWithOptions(request, runtime);
}

model DeleteFaceUserPictureRequest {
  facePicMd5?: string(name='FacePicMd5', example='1bb580ef7****'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  userId?: string(name='UserId', example='3mtjaqebeq4d****'),
}

model DeleteFaceUserPictureResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='face user not exist'),
  requestId?: string(name='RequestId', example='4de2c367-c1db-417c-aa15-8c585e595d92'),
  success?: boolean(name='Success', example='true'),
}

model DeleteFaceUserPictureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaceUserPictureResponseBody(name='body'),
}

async function deleteFaceUserPictureWithOptions(request: DeleteFaceUserPictureRequest, runtime: Util.RuntimeOptions): DeleteFaceUserPictureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.facePicMd5)) {
    query['FacePicMd5'] = request.facePicMd5;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFaceUserPicture',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFaceUserPicture(request: DeleteFaceUserPictureRequest): DeleteFaceUserPictureResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceUserPictureWithOptions(request, runtime);
}

model DeleteGbDeviceRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model DeleteGbDeviceResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteGbDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGbDeviceResponseBody(name='body'),
}

async function deleteGbDeviceWithOptions(request: DeleteGbDeviceRequest, runtime: Util.RuntimeOptions): DeleteGbDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGbDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteGbDevice(request: DeleteGbDeviceRequest): DeleteGbDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGbDeviceWithOptions(request, runtime);
}

model DeleteLocalFileUploadJobRequest {
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  jobId?: string(name='JobId', example='1ec1a2****d0435fbc0****34f6f139d'),
}

model DeleteLocalFileUploadJobResponseBody = {
  code?: string(name='Code', example='200'),
  data?: map[string]any(name='Data', example='{}'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model DeleteLocalFileUploadJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLocalFileUploadJobResponseBody(name='body'),
}

async function deleteLocalFileUploadJobWithOptions(request: DeleteLocalFileUploadJobRequest, runtime: Util.RuntimeOptions): DeleteLocalFileUploadJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLocalFileUploadJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteLocalFileUploadJob(request: DeleteLocalFileUploadJobRequest): DeleteLocalFileUploadJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLocalFileUploadJobWithOptions(request, runtime);
}

model DeletePictureRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='1CJ0****e7qiq8VkQi1000000'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y******'),
  pictureIdList?: [ string ](name='PictureIdList', example='cFc5MzZ****npYT1***TDFzX1hrVzA0Z****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model DeletePictureResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    deletedCount?: int32(name='DeletedCount', example='3'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model DeletePictureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePictureResponseBody(name='body'),
}

async function deletePictureWithOptions(request: DeletePictureRequest, runtime: Util.RuntimeOptions): DeletePictureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pictureIdList)) {
    query['PictureIdList'] = request.pictureIdList;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePicture',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePicture(request: DeletePictureRequest): DeletePictureResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePictureWithOptions(request, runtime);
}

model DeleteRecordRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  fileNameList?: [ string ](name='FileNameList', example='file1'),
  iotId?: string(name='IotId', example='d7XmBoJhAr88C6PelXDF00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-060a****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model DeleteRecordResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    deletedCount?: int32(name='DeletedCount', example='3'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error.'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model DeleteRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRecordResponseBody(name='body'),
}

async function deleteRecordWithOptions(request: DeleteRecordRequest, runtime: Util.RuntimeOptions): DeleteRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.fileNameList)) {
    query['FileNameList'] = request.fileNameList;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRecord',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRecord(request: DeleteRecordRequest): DeleteRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRecordWithOptions(request, runtime);
}

model DeleteRecordPlanRequest {
  planId?: string(name='PlanId', example='6c5a397bc17c4b48ace86f0f0c30****'),
}

model DeleteRecordPlanResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model DeleteRecordPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRecordPlanResponseBody(name='body'),
}

async function deleteRecordPlanWithOptions(request: DeleteRecordPlanRequest, runtime: Util.RuntimeOptions): DeleteRecordPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRecordPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRecordPlan(request: DeleteRecordPlanRequest): DeleteRecordPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRecordPlanWithOptions(request, runtime);
}

model DeleteRecordPlanDeviceRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model DeleteRecordPlanDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model DeleteRecordPlanDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRecordPlanDeviceResponseBody(name='body'),
}

async function deleteRecordPlanDeviceWithOptions(request: DeleteRecordPlanDeviceRequest, runtime: Util.RuntimeOptions): DeleteRecordPlanDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRecordPlanDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRecordPlanDevice(request: DeleteRecordPlanDeviceRequest): DeleteRecordPlanDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRecordPlanDeviceWithOptions(request, runtime);
}

model DeleteRtmpDeviceRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model DeleteRtmpDeviceResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteRtmpDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRtmpDeviceResponseBody(name='body'),
}

async function deleteRtmpDeviceWithOptions(request: DeleteRtmpDeviceRequest, runtime: Util.RuntimeOptions): DeleteRtmpDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRtmpDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRtmpDevice(request: DeleteRtmpDeviceRequest): DeleteRtmpDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRtmpDeviceWithOptions(request, runtime);
}

model DeleteRtmpKeyRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
  type?: int32(name='Type'),
}

model DeleteRtmpKeyResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteRtmpKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRtmpKeyResponseBody(name='body'),
}

async function deleteRtmpKeyWithOptions(request: DeleteRtmpKeyRequest, runtime: Util.RuntimeOptions): DeleteRtmpKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRtmpKey',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRtmpKey(request: DeleteRtmpKeyRequest): DeleteRtmpKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRtmpKeyWithOptions(request, runtime);
}

model DeleteStreamPushJobRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  jobId?: string(name='JobId'),
  productKey?: string(name='ProductKey'),
}

model DeleteStreamPushJobResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteStreamPushJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteStreamPushJobResponseBody(name='body'),
}

async function deleteStreamPushJobWithOptions(request: DeleteStreamPushJobRequest, runtime: Util.RuntimeOptions): DeleteStreamPushJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteStreamPushJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteStreamPushJob(request: DeleteStreamPushJobRequest): DeleteStreamPushJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteStreamPushJobWithOptions(request, runtime);
}

model DeleteStreamSnapshotJobRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
  streamType?: int32(name='StreamType'),
}

model DeleteStreamSnapshotJobResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteStreamSnapshotJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteStreamSnapshotJobResponseBody(name='body'),
}

async function deleteStreamSnapshotJobWithOptions(request: DeleteStreamSnapshotJobRequest, runtime: Util.RuntimeOptions): DeleteStreamSnapshotJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteStreamSnapshotJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteStreamSnapshotJob(request: DeleteStreamSnapshotJobRequest): DeleteStreamSnapshotJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteStreamSnapshotJobWithOptions(request, runtime);
}

model DeleteTimeTemplateRequest {
  templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
}

model DeleteTimeTemplateResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='RAM system auth error.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model DeleteTimeTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTimeTemplateResponseBody(name='body'),
}

async function deleteTimeTemplateWithOptions(request: DeleteTimeTemplateRequest, runtime: Util.RuntimeOptions): DeleteTimeTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTimeTemplate',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteTimeTemplate(request: DeleteTimeTemplateRequest): DeleteTimeTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTimeTemplateWithOptions(request, runtime);
}

model DetectUserFaceByUrlRequest {
  facePicUrl?: string(name='FacePicUrl', example='http://xxx.xxx.com/xxx/face/1.jpg'),
}

model DetectUserFaceByUrlResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    data?: [ 
    {
      age?: int32(name='Age', example='20'),
      blurScore?: float(name='BlurScore', example='0.795382022857666'),
      faceProbability?: float(name='FaceProbability', example='0.9999769926071167'),
      faceRects?: {
        faceRectsData?: [ string ](name='FaceRectsData')
      }(name='FaceRects'),
      gender?: int32(name='Gender', example='1'),
      goodForLibrary?: boolean(name='GoodForLibrary', example='true'),
      goodForRecognition?: boolean(name='GoodForRecognition', example='true'),
      landmarks?: {
        landmarksData?: [ string ](name='LandmarksData')
      }(name='Landmarks'),
      occlusionScore?: float(name='OcclusionScore', example='0.9867380261421204'),
      poseScore?: float(name='PoseScore', example='0.9167874261423875'),
    }
  ](name='data')
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='can not find this face'),
  requestId?: string(name='RequestId', example='df554760-7ccd-11eb-9a25-8f6d8670ef61'),
  success?: boolean(name='Success', example='true'),
}

model DetectUserFaceByUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetectUserFaceByUrlResponseBody(name='body'),
}

async function detectUserFaceByUrlWithOptions(request: DetectUserFaceByUrlRequest, runtime: Util.RuntimeOptions): DetectUserFaceByUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.facePicUrl)) {
    query['FacePicUrl'] = request.facePicUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetectUserFaceByUrl',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detectUserFaceByUrl(request: DetectUserFaceByUrlRequest): DetectUserFaceByUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return detectUserFaceByUrlWithOptions(request, runtime);
}

model EnableGbSubDeviceRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
  subDeviceId?: string(name='SubDeviceId'),
}

model EnableGbSubDeviceResponseBody = {
  code?: string(name='Code'),
  data?: {
    deviceName?: string(name='DeviceName'),
    productKey?: string(name='ProductKey'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableGbSubDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableGbSubDeviceResponseBody(name='body'),
}

async function enableGbSubDeviceWithOptions(request: EnableGbSubDeviceRequest, runtime: Util.RuntimeOptions): EnableGbSubDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.subDeviceId)) {
    query['SubDeviceId'] = request.subDeviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableGbSubDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableGbSubDevice(request: EnableGbSubDeviceRequest): EnableGbSubDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableGbSubDeviceWithOptions(request, runtime);
}

model GetPictureSearchJobStatusRequest {
  appInstanceId?: string(name='AppInstanceId', example='892f97c9518548469d319d955d98****'),
  jobId?: string(name='JobId', example='b3786935a71442efae014c7b2212****'),
}

model GetPictureSearchJobStatusResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    createTime?: long(name='CreateTime', example='1614850763000'),
    endTime?: long(name='EndTime', example='1614850763692'),
    jobId?: string(name='JobId', example='b3786935a71442efae014c7b2212****'),
    jobStatus?: int32(name='JobStatus', example='3'),
    searchPicUrl?: string(name='SearchPicUrl', example='http://XXX.XXX.com/1.jpg'),
    startTime?: long(name='StartTime', example='1614814763692'),
    threshold?: float(name='Threshold', example='0.5'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified access key is not found.'),
  requestId?: string(name='RequestId', example='2c7def10-7cce-11eb-8e79-959f4f722f76'),
  success?: boolean(name='Success', example='true'),
}

model GetPictureSearchJobStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPictureSearchJobStatusResponseBody(name='body'),
}

async function getPictureSearchJobStatusWithOptions(request: GetPictureSearchJobStatusRequest, runtime: Util.RuntimeOptions): GetPictureSearchJobStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPictureSearchJobStatus',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPictureSearchJobStatus(request: GetPictureSearchJobStatusRequest): GetPictureSearchJobStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPictureSearchJobStatusWithOptions(request, runtime);
}

model PictureSearchPictureRequest {
  appInstanceId?: string(name='AppInstanceId', example='5a502d3fbab8410e8fd4be9037c7****'),
  containPicUrl?: boolean(name='ContainPicUrl', example='true'),
  currentPage?: int32(name='CurrentPage', example='1'),
  endTime?: long(name='EndTime', example='1614850651299'),
  pageSize?: int32(name='PageSize', example='10'),
  pictureSearchType?: int32(name='PictureSearchType', example='1'),
  searchPicUrl?: string(name='SearchPicUrl', example='http://***.***/2393.jpg'),
  startTime?: long(name='StartTime', example='1614297000000'),
  threshold?: float(name='Threshold', example='0.5'),
}

model PictureSearchPictureResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        eventTime?: long(name='EventTime', example='1614500317482'),
        gatewayIotId?: string(name='GatewayIotId', example='pZJUqijOyfpFOOGNPF7S00****'),
        iotId?: string(name='IotId', example='5RUngwC1RknD4lPiHgH300****'),
        picUrl?: string(name='PicUrl', example='https://XXX.XXX/XXX'),
        threshold?: float(name='Threshold', example='0.5'),
        vectorId?: string(name='VectorId', example='vectorId86d9a5c32b9947278e526c2eef8a****'),
        vectorType?: int32(name='VectorType', example='1'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified parameter CurrentPage is not valid.'),
  requestId?: string(name='RequestId', example='3ddd5f30-7ccd-11eb-b164-bfd389491534'),
  success?: boolean(name='Success', example='true'),
}

model PictureSearchPictureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PictureSearchPictureResponseBody(name='body'),
}

async function pictureSearchPictureWithOptions(request: PictureSearchPictureRequest, runtime: Util.RuntimeOptions): PictureSearchPictureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.containPicUrl)) {
    query['ContainPicUrl'] = request.containPicUrl;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.pictureSearchType)) {
    query['PictureSearchType'] = request.pictureSearchType;
  }
  if (!Util.isUnset(request.searchPicUrl)) {
    query['SearchPicUrl'] = request.searchPicUrl;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PictureSearchPicture',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pictureSearchPicture(request: PictureSearchPictureRequest): PictureSearchPictureResponse {
  var runtime = new Util.RuntimeOptions{};
  return pictureSearchPictureWithOptions(request, runtime);
}

model QueryCarProcessEventsRequest {
  actionType?: int32(name='ActionType', example='2'),
  areaIndex?: int32(name='AreaIndex', example='1'),
  beginTime?: long(name='BeginTime', example='1646288487368'),
  currentPage?: int32(name='CurrentPage', example='1'),
  endTime?: long(name='EndTime', example='1646288488368'),
  iotInstanceId?: string(name='IotInstanceId', example='iotx-oxsshare****'),
  pageSize?: int32(name='PageSize', example='10'),
  plateNo?: string(name='PlateNo'),
  subDeviceName?: string(name='SubDeviceName', example='car_test'),
  subIotId?: string(name='SubIotId', example='ImP6ECd1aQ****CAfWTO000101'),
  subProductKey?: string(name='SubProductKey', example='a1Duh0F****'),
}

model QueryCarProcessEventsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        actionType?: int32(name='ActionType', example='1'),
        areaIndex?: int32(name='AreaIndex', example='0'),
        confidence?: int32(name='Confidence', example='63'),
        eventId?: string(name='EventId', example='dailyb3d6658d9****'),
        eventPicId?: string(name='EventPicId', example='SU5LT2pXaUM4MV****Nzg'),
        eventPicUrl?: string(name='EventPicUrl', example='https://example.com/test.jpg'),
        eventTime?: long(name='EventTime', example='1646288428361'),
        eventType?: int32(name='EventType', example='10005'),
        iotId?: string(name='IotId', example='gl9kLgp0UsPSCcIM8EAY00****'),
        plateNo?: string(name='PlateNo'),
        subDeviceName?: string(name='SubDeviceName', example='car_test'),
        subDeviceNickName?: string(name='SubDeviceNickName'),
        subIotId?: string(name='SubIotId', example='ImP6ECd1aQxio9CAfWTO****'),
        subProductKey?: string(name='SubProductKey', example='a1Duh0F****'),
        taskId?: string(name='TaskId', example='daily55617e7653354490938d****'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='50'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified access key is not found.'),
  requestId?: string(name='RequestId', example='8B8E77F0-7713-0139-A3D6-93482A025D45'),
  success?: boolean(name='Success', example='true'),
}

model QueryCarProcessEventsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCarProcessEventsResponseBody(name='body'),
}

async function queryCarProcessEventsWithOptions(request: QueryCarProcessEventsRequest, runtime: Util.RuntimeOptions): QueryCarProcessEventsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionType)) {
    query['ActionType'] = request.actionType;
  }
  if (!Util.isUnset(request.areaIndex)) {
    query['AreaIndex'] = request.areaIndex;
  }
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.plateNo)) {
    query['PlateNo'] = request.plateNo;
  }
  if (!Util.isUnset(request.subDeviceName)) {
    query['SubDeviceName'] = request.subDeviceName;
  }
  if (!Util.isUnset(request.subIotId)) {
    query['SubIotId'] = request.subIotId;
  }
  if (!Util.isUnset(request.subProductKey)) {
    query['SubProductKey'] = request.subProductKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCarProcessEvents',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryCarProcessEvents(request: QueryCarProcessEventsRequest): QueryCarProcessEventsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCarProcessEventsWithOptions(request, runtime);
}

model QueryDeviceEventRequest {
  beginTime?: long(name='BeginTime', example='1539507310000'),
  currentPage?: int32(name='CurrentPage', example='1'),
  deviceName?: string(name='DeviceName', example='camera1'),
  endTime?: long(name='EndTime', example='1539607310000'),
  eventType?: int32(name='EventType', example='0'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y****'),
  pageSize?: int32(name='PageSize', example='10'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model QueryDeviceEventResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        eventData?: string(name='EventData', example='{}'),
        eventDesc?: string(name='EventDesc'),
        eventId?: string(name='EventId', example='ae6b74f1dc7d****85d32c210185967f_16080****9471'),
        eventPicId?: string(name='EventPicId', example='aEtMSm9****ORTFxcGpTbDZ****6eTk0'),
        eventTime?: string(name='EventTime', example='2020-12-15 20:40:49'),
        eventType?: int32(name='EventType', example='1'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='2'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDeviceEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceEventResponseBody(name='body'),
}

async function queryDeviceEventWithOptions(request: QueryDeviceEventRequest, runtime: Util.RuntimeOptions): QueryDeviceEventResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceEvent',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDeviceEvent(request: QueryDeviceEventRequest): QueryDeviceEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceEventWithOptions(request, runtime);
}

model QueryDeviceEventPictureRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  eventId?: string(name='EventId', example='ae6b74f1dc7d402****32c21018****f1608036****71'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y*****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model QueryDeviceEventPictureResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: string(name='Data', example='oss://***/***.jpg'),
  errorMessage?: string(name='ErrorMessage', example='product is not active'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDeviceEventPictureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceEventPictureResponseBody(name='body'),
}

async function queryDeviceEventPictureWithOptions(request: QueryDeviceEventPictureRequest, runtime: Util.RuntimeOptions): QueryDeviceEventPictureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceEventPicture',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDeviceEventPicture(request: QueryDeviceEventPictureRequest): QueryDeviceEventPictureResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceEventPictureWithOptions(request, runtime);
}

model QueryDeviceEventRecordRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  eventId?: string(name='EventId', example='907084996e1d44788d0*****43906_160803*****37'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1****z0t'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model QueryDeviceEventRecordResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ 
    {
      beginTime?: string(name='BeginTime', example='2021-09-08 15:55:35'),
      endTime?: string(name='EndTime', example='2021-09-08 15:56:32'),
      fileName?: string(name='FileName', example='file1'),
      vodUrl?: string(name='VodUrl', example='rtmp://****/****.mp4'),
    }
  ](name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDeviceEventRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceEventRecordResponseBody(name='body'),
}

async function queryDeviceEventRecordWithOptions(request: QueryDeviceEventRecordRequest, runtime: Util.RuntimeOptions): QueryDeviceEventRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceEventRecord',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDeviceEventRecord(request: QueryDeviceEventRecordRequest): QueryDeviceEventRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceEventRecordWithOptions(request, runtime);
}

model QueryDevicePictureByListRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  expireTime?: int32(name='ExpireTime', example='60'),
  iotId?: string(name='IotId', example='1CJ0****e7qiq8VkQi1000000'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y******'),
  pictureIdList?: [ string ](name='PictureIdList', example='cFc5MzZ****npYT1***TDFzX1hrVzA0Z****'),
  pictureType?: int32(name='PictureType', example='2'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  thumbWidth?: int32(name='ThumbWidth', example='100'),
}

model QueryDevicePictureByListResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    picData?: [ 
    {
      iotId?: string(name='IotId', example='1CJ0****e7qiq8VkQi1000000'),
      picCreateTime?: long(name='PicCreateTime', example='1632453652222'),
      picId?: string(name='PicId', example='RW****HFRO****jUyMjIy'),
      picUrl?: string(name='PicUrl', example='https://link-vision-picture-sh.oss-cn-shanghai.aliyuncs.com/EbOEp****%3D'),
      thumbUrl?: string(name='ThumbUrl', example='https://link-vision-picture-sh.oss-cn-shanghai.aliyuncs.com/EbOEpDE****%2Cq_90'),
    }
  ](name='picData')
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDevicePictureByListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDevicePictureByListResponseBody(name='body'),
}

async function queryDevicePictureByListWithOptions(request: QueryDevicePictureByListRequest, runtime: Util.RuntimeOptions): QueryDevicePictureByListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pictureIdList)) {
    query['PictureIdList'] = request.pictureIdList;
  }
  if (!Util.isUnset(request.pictureType)) {
    query['PictureType'] = request.pictureType;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.thumbWidth)) {
    query['ThumbWidth'] = request.thumbWidth;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDevicePictureByList',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDevicePictureByList(request: QueryDevicePictureByListRequest): QueryDevicePictureByListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDevicePictureByListWithOptions(request, runtime);
}

model QueryDevicePictureFileRequest {
  captureId?: string(name='CaptureId', example='fdc576d03c094faea9fa10fbf48c****'),
  deviceName?: string(name='DeviceName', example='camera1'),
  expireTime?: int32(name='ExpireTime', example='60'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y******'),
  pictureType?: int32(name='PictureType', example='1'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  thumbWidth?: int32(name='ThumbWidth', example='100'),
}

model QueryDevicePictureFileResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    iotId?: string(name='IotId', example='1CJ0***kQi1000000'),
    picCreateTime?: long(name='PicCreateTime', example='1632453652222'),
    picId?: string(name='PicId', example='R****bVhsNCjMjIy'),
    picUrl?: string(name='PicUrl', example='https://link-vision-picture-sh.oss-cn-shanghai.aliyuncs.com/E***3D'),
    thumbUrl?: string(name='ThumbUrl', example='https://link-vision-picture-sh.oss-cn-shanghai.aliyuncs.com/E***2Cq_90'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDevicePictureFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDevicePictureFileResponseBody(name='body'),
}

async function queryDevicePictureFileWithOptions(request: QueryDevicePictureFileRequest, runtime: Util.RuntimeOptions): QueryDevicePictureFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.captureId)) {
    query['CaptureId'] = request.captureId;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pictureType)) {
    query['PictureType'] = request.pictureType;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.thumbWidth)) {
    query['ThumbWidth'] = request.thumbWidth;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDevicePictureFile',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDevicePictureFile(request: QueryDevicePictureFileRequest): QueryDevicePictureFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDevicePictureFileWithOptions(request, runtime);
}

model QueryDevicePictureLifeCycleRequest {
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
}

model QueryDevicePictureLifeCycleResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    day?: int32(name='Day', example='7'),
    iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='0E2244FD-0AC9-4AB4-A8F0-729D78BE1D77'),
  success?: boolean(name='Success', example='true'),
}

model QueryDevicePictureLifeCycleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDevicePictureLifeCycleResponseBody(name='body'),
}

async function queryDevicePictureLifeCycleWithOptions(request: QueryDevicePictureLifeCycleRequest, runtime: Util.RuntimeOptions): QueryDevicePictureLifeCycleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDevicePictureLifeCycle',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDevicePictureLifeCycle(request: QueryDevicePictureLifeCycleRequest): QueryDevicePictureLifeCycleResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDevicePictureLifeCycleWithOptions(request, runtime);
}

model QueryDeviceRecordLifeCycleRequest {
  deviceList?: [ string ](name='DeviceList', example='["C47T6xwp6ms4bNlkHRWCg4****", "d7XmBoJhAr88C6PelXDF00****"]'),
}

model QueryDeviceRecordLifeCycleResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ 
    {
      day?: int32(name='Day', example='7'),
      iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
    }
  ](name='Data'),
  errorMessage?: string(name='ErrorMessage', example='InvalidParameters'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDeviceRecordLifeCycleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceRecordLifeCycleResponseBody(name='body'),
}

async function queryDeviceRecordLifeCycleWithOptions(request: QueryDeviceRecordLifeCycleRequest, runtime: Util.RuntimeOptions): QueryDeviceRecordLifeCycleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceList)) {
    query['DeviceList'] = request.deviceList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceRecordLifeCycle',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDeviceRecordLifeCycle(request: QueryDeviceRecordLifeCycleRequest): QueryDeviceRecordLifeCycleResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceRecordLifeCycleWithOptions(request, runtime);
}

model QueryDeviceVodUrlRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  enableStun?: boolean(name='EnableStun'),
  encryptType?: int32(name='EncryptType', example='0'),
  fileName?: string(name='FileName', example='file1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  playUnLimited?: boolean(name='PlayUnLimited', example='false'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  scheme?: string(name='Scheme', example='rtmp'),
  seekTime?: int32(name='SeekTime', example='0'),
  shouldEncrypt?: boolean(name='ShouldEncrypt', example='false'),
  urlValidDuration?: int32(name='UrlValidDuration', example='60'),
}

model QueryDeviceVodUrlResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    decryptKey?: string(name='DecryptKey', example='{"iv": "MDEy****OTo7PD0+Pw==","key": "eA2r****fHjOmnyBfQ=="}'),
    stunInfo?: string(name='StunInfo'),
    vodUrl?: string(name='VodUrl', example='rtmp://***/***.mp4'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='product is not active.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDeviceVodUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceVodUrlResponseBody(name='body'),
}

async function queryDeviceVodUrlWithOptions(request: QueryDeviceVodUrlRequest, runtime: Util.RuntimeOptions): QueryDeviceVodUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.enableStun)) {
    query['EnableStun'] = request.enableStun;
  }
  if (!Util.isUnset(request.encryptType)) {
    query['EncryptType'] = request.encryptType;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.playUnLimited)) {
    query['PlayUnLimited'] = request.playUnLimited;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.scheme)) {
    query['Scheme'] = request.scheme;
  }
  if (!Util.isUnset(request.seekTime)) {
    query['SeekTime'] = request.seekTime;
  }
  if (!Util.isUnset(request.shouldEncrypt)) {
    query['ShouldEncrypt'] = request.shouldEncrypt;
  }
  if (!Util.isUnset(request.urlValidDuration)) {
    query['UrlValidDuration'] = request.urlValidDuration;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceVodUrl',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDeviceVodUrl(request: QueryDeviceVodUrlRequest): QueryDeviceVodUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceVodUrlWithOptions(request, runtime);
}

model QueryDeviceVodUrlByTimeRequest {
  beginTime?: int32(name='BeginTime', example='1508200012'),
  deviceName?: string(name='DeviceName', example='camera1'),
  enableStun?: boolean(name='EnableStun'),
  encryptType?: int32(name='EncryptType', example='0'),
  endTime?: int32(name='EndTime', example='1582420940'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y****'),
  playUnLimited?: boolean(name='PlayUnLimited', example='false'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  scheme?: string(name='Scheme', example='rtmp'),
  seekTime?: int32(name='SeekTime', example='0'),
  shouldEncrypt?: boolean(name='ShouldEncrypt', example='false'),
  urlValidDuration?: int32(name='UrlValidDuration', example='60'),
}

model QueryDeviceVodUrlByTimeResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    decryptKey?: string(name='DecryptKey', example='{"iv": "MDEy****OTo7PD0+Pw==","key": "eA2r****fHjOmnyBfQ=="}'),
    stunInfo?: string(name='StunInfo'),
    vodUrl?: string(name='VodUrl', example='https://iotx-vision-vod-vpc-hz-pre.aliyun-inc.com/vod/device/localrecord/flv/play/1****668.flv?token=e9****a9e14482c56be52&session=470e****3d015'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryDeviceVodUrlByTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDeviceVodUrlByTimeResponseBody(name='body'),
}

async function queryDeviceVodUrlByTimeWithOptions(request: QueryDeviceVodUrlByTimeRequest, runtime: Util.RuntimeOptions): QueryDeviceVodUrlByTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.enableStun)) {
    query['EnableStun'] = request.enableStun;
  }
  if (!Util.isUnset(request.encryptType)) {
    query['EncryptType'] = request.encryptType;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.playUnLimited)) {
    query['PlayUnLimited'] = request.playUnLimited;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.scheme)) {
    query['Scheme'] = request.scheme;
  }
  if (!Util.isUnset(request.seekTime)) {
    query['SeekTime'] = request.seekTime;
  }
  if (!Util.isUnset(request.shouldEncrypt)) {
    query['ShouldEncrypt'] = request.shouldEncrypt;
  }
  if (!Util.isUnset(request.urlValidDuration)) {
    query['UrlValidDuration'] = request.urlValidDuration;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDeviceVodUrlByTime',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDeviceVodUrlByTime(request: QueryDeviceVodUrlByTimeRequest): QueryDeviceVodUrlByTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDeviceVodUrlByTimeWithOptions(request, runtime);
}

model QueryEventRecordPlanDetailRequest {
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
}

model QueryEventRecordPlanDetailResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    name?: string(name='Name', example='record1'),
    planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
    preRecordDuration?: int32(name='PreRecordDuration', example='30'),
    recordDuration?: int32(name='RecordDuration', example='120'),
    templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
    templateInfo?: {
      allDay?: int32(name='AllDay', example='0'),
      default?: int32(name='Default', example='0'),
      name?: string(name='Name', example='temp1'),
      templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
      timeSectionList?: [ 
        {
          begin?: int32(name='Begin', example='6000'),
          dayOfWeek?: int32(name='DayOfWeek', example='0'),
          end?: int32(name='End', example='20000'),
        }
      ](name='TimeSectionList'),
    }(name='TemplateInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryEventRecordPlanDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryEventRecordPlanDetailResponseBody(name='body'),
}

async function queryEventRecordPlanDetailWithOptions(request: QueryEventRecordPlanDetailRequest, runtime: Util.RuntimeOptions): QueryEventRecordPlanDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEventRecordPlanDetail',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEventRecordPlanDetail(request: QueryEventRecordPlanDetailRequest): QueryEventRecordPlanDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEventRecordPlanDetailWithOptions(request, runtime);
}

model QueryEventRecordPlanDeviceByDeviceRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model QueryEventRecordPlanDeviceByDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    name?: string(name='Name', example='planAA'),
    planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
    preRecordDuration?: int32(name='PreRecordDuration', example='5'),
    recordDuration?: int32(name='RecordDuration', example='120'),
    templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
    templateInfo?: {
      allDay?: int32(name='AllDay', example='0'),
      default?: int32(name='Default', example='0'),
      name?: string(name='Name', example='testtime1'),
      templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
      timeSectionList?: [ 
        {
          begin?: int32(name='Begin', example='0'),
          dayOfWeek?: int32(name='DayOfWeek', example='0'),
          end?: int32(name='End', example='86399'),
        }
      ](name='TimeSectionList'),
    }(name='TemplateInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryEventRecordPlanDeviceByDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryEventRecordPlanDeviceByDeviceResponseBody(name='body'),
}

async function queryEventRecordPlanDeviceByDeviceWithOptions(request: QueryEventRecordPlanDeviceByDeviceRequest, runtime: Util.RuntimeOptions): QueryEventRecordPlanDeviceByDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEventRecordPlanDeviceByDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEventRecordPlanDeviceByDevice(request: QueryEventRecordPlanDeviceByDeviceRequest): QueryEventRecordPlanDeviceByDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEventRecordPlanDeviceByDeviceWithOptions(request, runtime);
}

model QueryEventRecordPlanDeviceByPlanRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
}

model QueryEventRecordPlanDeviceByPlanResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        iotId?: string(name='IotId', example='P7WqhWvhplhHlWPO9Op5g4****'),
        streamType?: int32(name='StreamType', example='1'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='2'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryEventRecordPlanDeviceByPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryEventRecordPlanDeviceByPlanResponseBody(name='body'),
}

async function queryEventRecordPlanDeviceByPlanWithOptions(request: QueryEventRecordPlanDeviceByPlanRequest, runtime: Util.RuntimeOptions): QueryEventRecordPlanDeviceByPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEventRecordPlanDeviceByPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEventRecordPlanDeviceByPlan(request: QueryEventRecordPlanDeviceByPlanRequest): QueryEventRecordPlanDeviceByPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEventRecordPlanDeviceByPlanWithOptions(request, runtime);
}

model QueryEventRecordPlansRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryEventRecordPlansResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        eventType?: string(name='EventType', example='1'),
        name?: string(name='Name', example='test'),
        planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
        preRecordDuration?: int32(name='PreRecordDuration', example='5'),
        recordDuration?: int32(name='RecordDuration', example='60'),
        templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryEventRecordPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryEventRecordPlansResponseBody(name='body'),
}

async function queryEventRecordPlansWithOptions(request: QueryEventRecordPlansRequest, runtime: Util.RuntimeOptions): QueryEventRecordPlansResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEventRecordPlans',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEventRecordPlans(request: QueryEventRecordPlansRequest): QueryEventRecordPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEventRecordPlansWithOptions(request, runtime);
}

model QueryFaceAllDeviceGroupRequest {
  iotInstanceId?: string(name='IotInstanceId', example='TestIotInstanceId'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
}

model QueryFaceAllDeviceGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    deviceGroupList?: [ 
      {
        deviceGroupId?: string(name='DeviceGroupId', example='wy250q0m'),
        deviceGroupName?: string(name='DeviceGroupName', example='TestDeviceGroupName'),
        modifiedTime?: string(name='ModifiedTime', example='2020-05-12 17:19:29'),
      }
    ](name='DeviceGroupList'),
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='100'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceAllDeviceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceAllDeviceGroupResponseBody(name='body'),
}

async function queryFaceAllDeviceGroupWithOptions(request: QueryFaceAllDeviceGroupRequest, runtime: Util.RuntimeOptions): QueryFaceAllDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceAllDeviceGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceAllDeviceGroup(request: QueryFaceAllDeviceGroupRequest): QueryFaceAllDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceAllDeviceGroupWithOptions(request, runtime);
}

model QueryFaceAllUserGroupRequest {
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
}

model QueryFaceAllUserGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='100'),
    userGroupList?: [ 
      {
        modifiedTime?: string(name='ModifiedTime', example='2020-05-12 17:12:37'),
        userGroupId?: string(name='UserGroupId', example='dmjpxfdk'),
        userGroupName?: string(name='UserGroupName', example='TestUserGroupName'),
      }
    ](name='UserGroupList'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceAllUserGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceAllUserGroupResponseBody(name='body'),
}

async function queryFaceAllUserGroupWithOptions(request: QueryFaceAllUserGroupRequest, runtime: Util.RuntimeOptions): QueryFaceAllUserGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceAllUserGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceAllUserGroup(request: QueryFaceAllUserGroupRequest): QueryFaceAllUserGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceAllUserGroupWithOptions(request, runtime);
}

model QueryFaceAllUserGroupAndDeviceGroupRelationRequest {
  isolationId?: string(name='IsolationId', example='Isolati***'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
}

model QueryFaceAllUserGroupAndDeviceGroupRelationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        controlId?: string(name='ControlId', example='ni1iyxqry0j0****'),
        controlType?: string(name='ControlType', example='SYNC_INFO_PICTURE'),
        deviceGroupId?: string(name='DeviceGroupId', example='TestDeviceGro****'),
        modifiedTime?: string(name='ModifiedTime', example='2020-05-12 17:12:37'),
        userGroupId?: string(name='UserGroupId', example='TestUserGro****'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='10'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceAllUserGroupAndDeviceGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceAllUserGroupAndDeviceGroupRelationResponseBody(name='body'),
}

async function queryFaceAllUserGroupAndDeviceGroupRelationWithOptions(request: QueryFaceAllUserGroupAndDeviceGroupRelationRequest, runtime: Util.RuntimeOptions): QueryFaceAllUserGroupAndDeviceGroupRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceAllUserGroupAndDeviceGroupRelation',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceAllUserGroupAndDeviceGroupRelation(request: QueryFaceAllUserGroupAndDeviceGroupRelationRequest): QueryFaceAllUserGroupAndDeviceGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceAllUserGroupAndDeviceGroupRelationWithOptions(request, runtime);
}

model QueryFaceAllUserIdsByGroupIdRequest {
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  userGroupId?: string(name='UserGroupId', example='TestUserGroupId'),
}

model QueryFaceAllUserIdsByGroupIdResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        customUserId?: string(name='CustomUserId', example='TestCustomUserId'),
        name?: string(name='Name', example='TestName'),
        params?: string(name='Params', example='{"age":28, "sex":"male"}'),
        userId?: string(name='UserId', example='TestUserId'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='100'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceAllUserIdsByGroupIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceAllUserIdsByGroupIdResponseBody(name='body'),
}

async function queryFaceAllUserIdsByGroupIdWithOptions(request: QueryFaceAllUserIdsByGroupIdRequest, runtime: Util.RuntimeOptions): QueryFaceAllUserIdsByGroupIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userGroupId)) {
    query['UserGroupId'] = request.userGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceAllUserIdsByGroupId',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceAllUserIdsByGroupId(request: QueryFaceAllUserIdsByGroupIdRequest): QueryFaceAllUserIdsByGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceAllUserIdsByGroupIdWithOptions(request, runtime);
}

model QueryFaceCustomUserIdByUserIdRequest {
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  userId?: string(name='UserId', example='TestUserId'),
}

model QueryFaceCustomUserIdByUserIdResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='TestCustomUserId'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceCustomUserIdByUserIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceCustomUserIdByUserIdResponseBody(name='body'),
}

async function queryFaceCustomUserIdByUserIdWithOptions(request: QueryFaceCustomUserIdByUserIdRequest, runtime: Util.RuntimeOptions): QueryFaceCustomUserIdByUserIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceCustomUserIdByUserId',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceCustomUserIdByUserId(request: QueryFaceCustomUserIdByUserIdRequest): QueryFaceCustomUserIdByUserIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceCustomUserIdByUserIdWithOptions(request, runtime);
}

model QueryFaceDeviceGroupsByDeviceRequest {
  deviceName?: string(name='DeviceName', example='TestDeviceName'),
  iotInstanceId?: string(name='IotInstanceId', example='TestIotInstanceId'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  productKey?: string(name='ProductKey', example='TestProductKey'),
}

model QueryFaceDeviceGroupsByDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    deviceGroupList?: [ 
      {
        deviceGroupId?: string(name='DeviceGroupId', example='TestDeviceGroupId'),
        deviceGroupName?: string(name='DeviceGroupName', example='TestDeviceGroupName'),
        modifiedTime?: string(name='ModifiedTime', example='2020-05-12 17:12:37'),
      }
    ](name='DeviceGroupList'),
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='5'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceDeviceGroupsByDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceDeviceGroupsByDeviceResponseBody(name='body'),
}

async function queryFaceDeviceGroupsByDeviceWithOptions(request: QueryFaceDeviceGroupsByDeviceRequest, runtime: Util.RuntimeOptions): QueryFaceDeviceGroupsByDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceDeviceGroupsByDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceDeviceGroupsByDevice(request: QueryFaceDeviceGroupsByDeviceRequest): QueryFaceDeviceGroupsByDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceDeviceGroupsByDeviceWithOptions(request, runtime);
}

model QueryFaceUserRequest {
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  userId?: string(name='UserId', example='TestUserId'),
}

model QueryFaceUserResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    customUserId?: string(name='CustomUserId', example='TestCustomUserId'),
    facePicList?: [ 
      {
        faceMd5?: string(name='FaceMd5', example='TestFaceMd5'),
        faceUrl?: string(name='FaceUrl', example='https://test.com/xxx.jpg'),
        featureDTOList?: [ 
          {
            algorithmName?: string(name='AlgorithmName', example='TestAlgorithmName'),
            algorithmProvider?: string(name='AlgorithmProvider', example='TestAlgorithmProvider'),
            algorithmVersion?: string(name='AlgorithmVersion', example='TestAlgorithmVersion'),
            errorCode?: string(name='ErrorCode', example='200'),
            errorMessage?: string(name='ErrorMessage', example='success'),
            faceMd5?: string(name='FaceMd5', example='TestFaceMd5'),
          }
        ](name='FeatureDTOList'),
      }
    ](name='FacePicList'),
    name?: string(name='Name', example='TestName'),
    params?: string(name='Params', example='{"age":28, "sex":"male"}'),
    userId?: string(name='UserId', example='TestUserId'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceUserResponseBody(name='body'),
}

async function queryFaceUserWithOptions(request: QueryFaceUserRequest, runtime: Util.RuntimeOptions): QueryFaceUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceUser',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceUser(request: QueryFaceUserRequest): QueryFaceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceUserWithOptions(request, runtime);
}

model QueryFaceUserBatchRequest {
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  userIdList?: [ string ](name='UserIdList', example='["xqymlby****4whye","6qyyb69zqara****","64nbfx8****hzmy4"]'),
}

model QueryFaceUserBatchResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      createTime?: long(name='CreateTime', example='1636427314000'),
      customUserId?: string(name='CustomUserId', example='1234567890'),
      facePicList?: [ 
        {
          faceMd5?: string(name='FaceMd5', example='TestFaceMd5'),
          faceUrl?: string(name='FaceUrl', example='https://example.com/test.jpeg'),
          featureDTOList?: [ 
            {
              algorithmName?: string(name='AlgorithmName', example='TestAlgorithmName'),
              algorithmProvider?: string(name='AlgorithmProvider', example='TestAlgorithmProvider'),
              algorithmVersion?: string(name='AlgorithmVersion', example='TestAlgorithmVersion'),
              errorCode?: string(name='ErrorCode', example='200'),
              errorMessage?: string(name='ErrorMessage', example='parameter error'),
              faceMd5?: string(name='FaceMd5', example='TestFaceMd5'),
            }
          ](name='FeatureDTOList'),
        }
      ](name='FacePicList'),
      modifyTime?: long(name='ModifyTime', example='1636436864000'),
      name?: string(name='Name', example='Tony'),
      params?: string(name='Params', example='{"key1":"value1", "key2":"value2"}'),
      userId?: string(name='UserId', example='3mtjaqebeq4d****'),
    }
  ](name='Data'),
  errorMessage?: string(name='ErrorMessage', example='face user not exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceUserBatchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceUserBatchResponseBody(name='body'),
}

async function queryFaceUserBatchWithOptions(request: QueryFaceUserBatchRequest, runtime: Util.RuntimeOptions): QueryFaceUserBatchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userIdList)) {
    query['UserIdList'] = request.userIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceUserBatch',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceUserBatch(request: QueryFaceUserBatchRequest): QueryFaceUserBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceUserBatchWithOptions(request, runtime);
}

model QueryFaceUserByNameRequest {
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  name?: string(name='Name', example='Tony'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  params?: string(name='Params', example='{"key1":"value1", "key2":"value2"}'),
}

model QueryFaceUserByNameResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        createTime?: long(name='CreateTime', example='1636427314000'),
        customUserId?: string(name='CustomUserId', example='1234567890'),
        facePicList?: [ 
          {
            faceMd5?: string(name='FaceMd5', example='TestFaceMd5'),
            faceUrl?: string(name='FaceUrl', example='https://example.com/test.jpeg'),
            featureDTOList?: [ 
              {
                algorithmName?: string(name='AlgorithmName', example='TestAlgorithmName'),
                algorithmProvider?: string(name='AlgorithmProvider', example='TestAlgorithmProvider'),
                algorithmVersion?: string(name='AlgorithmVersion', example='TestAlgorithmVersion'),
                errorCode?: string(name='ErrorCode', example='200'),
                errorMessage?: string(name='ErrorMessage', example='parameter error'),
                faceMd5?: string(name='FaceMd5', example='TestFaceMd5'),
              }
            ](name='FeatureDTOList'),
          }
        ](name='FacePicList'),
        modifyTime?: long(name='ModifyTime', example='1636436864000'),
        name?: string(name='Name', example='Tony'),
        params?: string(name='Params', example='{"key1":"value1", "key2":"value2"}'),
        userId?: string(name='UserId', example='3mtjaqebeq4d****'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='15'),
    total?: int32(name='Total', example='8'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='face user not exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceUserByNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceUserByNameResponseBody(name='body'),
}

async function queryFaceUserByNameWithOptions(request: QueryFaceUserByNameRequest, runtime: Util.RuntimeOptions): QueryFaceUserByNameResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.params)) {
    query['Params'] = request.params;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceUserByName',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceUserByName(request: QueryFaceUserByNameRequest): QueryFaceUserByNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceUserByNameWithOptions(request, runtime);
}

model QueryFaceUserGroupRequest {
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  userId?: string(name='UserId', example='TestUserId'),
}

model QueryFaceUserGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='5'),
    userGroupList?: [ 
      {
        modifiedTime?: string(name='ModifiedTime', example='2020-05-12 17:12:37'),
        userGroupId?: string(name='UserGroupId', example='TestUserGroupId'),
        userGroupName?: string(name='UserGroupName', example='TestUserGroupName'),
      }
    ](name='UserGroupList'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceUserGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceUserGroupResponseBody(name='body'),
}

async function queryFaceUserGroupWithOptions(request: QueryFaceUserGroupRequest, runtime: Util.RuntimeOptions): QueryFaceUserGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceUserGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceUserGroup(request: QueryFaceUserGroupRequest): QueryFaceUserGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceUserGroupWithOptions(request, runtime);
}

model QueryFaceUserGroupAndDeviceGroupRelationRequest {
  controlId?: string(name='ControlId', example='ni1iyxqry0j03plv'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
}

model QueryFaceUserGroupAndDeviceGroupRelationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    controlId?: string(name='ControlId', example='ni1iyxqry0j03plv'),
    controlType?: string(name='ControlType', example='SYNC_INFO_PICTURE'),
    deviceGroupId?: string(name='DeviceGroupId', example='TestDeviceGroupId'),
    modifiedTime?: string(name='ModifiedTime', example='2020-05-12 17:12:37'),
    userGroupId?: string(name='UserGroupId', example='TestUserGroupId'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceUserGroupAndDeviceGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceUserGroupAndDeviceGroupRelationResponseBody(name='body'),
}

async function queryFaceUserGroupAndDeviceGroupRelationWithOptions(request: QueryFaceUserGroupAndDeviceGroupRelationRequest, runtime: Util.RuntimeOptions): QueryFaceUserGroupAndDeviceGroupRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.controlId)) {
    query['ControlId'] = request.controlId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceUserGroupAndDeviceGroupRelation',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceUserGroupAndDeviceGroupRelation(request: QueryFaceUserGroupAndDeviceGroupRelationRequest): QueryFaceUserGroupAndDeviceGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceUserGroupAndDeviceGroupRelationWithOptions(request, runtime);
}

model QueryFaceUserIdByCustomUserIdRequest {
  customUserId?: string(name='CustomUserId', example='TestCustomUserId'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
}

model QueryFaceUserIdByCustomUserIdResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    customUserId?: string(name='CustomUserId', example='TestCustomUserId'),
    name?: string(name='Name', example='TestName'),
    params?: string(name='Params', example='{"age":28, "sex":"male"}'),
    userId?: string(name='UserId', example='TestUserId'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model QueryFaceUserIdByCustomUserIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryFaceUserIdByCustomUserIdResponseBody(name='body'),
}

async function queryFaceUserIdByCustomUserIdWithOptions(request: QueryFaceUserIdByCustomUserIdRequest, runtime: Util.RuntimeOptions): QueryFaceUserIdByCustomUserIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customUserId)) {
    query['CustomUserId'] = request.customUserId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryFaceUserIdByCustomUserId',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFaceUserIdByCustomUserId(request: QueryFaceUserIdByCustomUserIdRequest): QueryFaceUserIdByCustomUserIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFaceUserIdByCustomUserIdWithOptions(request, runtime);
}

model QueryGbSubDeviceListRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  pageSize?: int32(name='PageSize'),
  pageStart?: int32(name='PageStart'),
  productKey?: string(name='ProductKey'),
}

model QueryGbSubDeviceListResponseBody = {
  code?: string(name='Code'),
  data?: {
    gbSubDeviceList?: [ 
      {
        deviceEnable?: int32(name='DeviceEnable'),
        deviceId?: string(name='DeviceId'),
        deviceName?: string(name='DeviceName'),
        iotId?: string(name='IotId'),
        productKey?: string(name='ProductKey'),
      }
    ](name='GbSubDeviceList'),
    total?: int32(name='Total'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryGbSubDeviceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryGbSubDeviceListResponseBody(name='body'),
}

async function queryGbSubDeviceListWithOptions(request: QueryGbSubDeviceListRequest, runtime: Util.RuntimeOptions): QueryGbSubDeviceListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.pageStart)) {
    query['PageStart'] = request.pageStart;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryGbSubDeviceList',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryGbSubDeviceList(request: QueryGbSubDeviceListRequest): QueryGbSubDeviceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryGbSubDeviceListWithOptions(request, runtime);
}

model QueryLiveStreamingRequest {
  cacheDuration?: int32(name='CacheDuration', example='0'),
  deviceName?: string(name='DeviceName', example='camera1'),
  enableStun?: boolean(name='EnableStun'),
  encryptType?: int32(name='EncryptType', example='1'),
  forceIFrame?: boolean(name='ForceIFrame', example='false'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  playUnLimited?: boolean(name='PlayUnLimited', example='false'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  scheme?: string(name='Scheme', example='rtmp'),
  shouldEncrypt?: boolean(name='ShouldEncrypt', example='true'),
  streamType?: int32(name='StreamType', example='0'),
  urlValidDuration?: int32(name='UrlValidDuration', example='60'),
}

model QueryLiveStreamingResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    path?: string(name='Path', example='rtmp://47.100.***.***:8000/live?token=dc1****120ce394ef94974/Eb****6RBe8l4_0'),
    relayDecryptKey?: string(name='RelayDecryptKey'),
    stunInfo?: string(name='StunInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='stream push failed'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryLiveStreamingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryLiveStreamingResponseBody(name='body'),
}

async function queryLiveStreamingWithOptions(request: QueryLiveStreamingRequest, runtime: Util.RuntimeOptions): QueryLiveStreamingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cacheDuration)) {
    query['CacheDuration'] = request.cacheDuration;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.enableStun)) {
    query['EnableStun'] = request.enableStun;
  }
  if (!Util.isUnset(request.encryptType)) {
    query['EncryptType'] = request.encryptType;
  }
  if (!Util.isUnset(request.forceIFrame)) {
    query['ForceIFrame'] = request.forceIFrame;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.playUnLimited)) {
    query['PlayUnLimited'] = request.playUnLimited;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.scheme)) {
    query['Scheme'] = request.scheme;
  }
  if (!Util.isUnset(request.shouldEncrypt)) {
    query['ShouldEncrypt'] = request.shouldEncrypt;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  if (!Util.isUnset(request.urlValidDuration)) {
    query['UrlValidDuration'] = request.urlValidDuration;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryLiveStreaming',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryLiveStreaming(request: QueryLiveStreamingRequest): QueryLiveStreamingResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryLiveStreamingWithOptions(request, runtime);
}

model QueryLocalFileUploadJobRequest {
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  jobId?: string(name='JobId', example='1ec1a****5d0435fbc0****34f6f139d'),
}

model QueryLocalFileUploadJobResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    resultList?: [ 
      {
        code?: int32(name='Code', example='9201'),
        deviceName?: string(name='DeviceName', example='gb_hik_IPC'),
        fileList?: [ 
          {
            fileEndTime?: int32(name='FileEndTime', example='1634746054'),
            fileName?: string(name='FileName', example='video1'),
            fileStartTime?: int32(name='FileStartTime', example='1634747054'),
          }
        ](name='FileList'),
        iotId?: string(name='IotId', example='IQ9mO4tvMnAj****QUdcg2n400'),
        productKey?: string(name='ProductKey', example='g2****Q6ggK'),
        slotEndTime?: int32(name='SlotEndTime', example='1634746054'),
        slotStartTime?: int32(name='SlotStartTime', example='1634745754'),
        slotStatus?: int32(name='SlotStatus', example='3'),
      }
    ](name='ResultList'),
    status?: int32(name='Status', example='2'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='449ECE75-A36A-4ACE-B253-147C78C440C5'),
  success?: boolean(name='Success', example='true'),
}

model QueryLocalFileUploadJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryLocalFileUploadJobResponseBody(name='body'),
}

async function queryLocalFileUploadJobWithOptions(request: QueryLocalFileUploadJobRequest, runtime: Util.RuntimeOptions): QueryLocalFileUploadJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryLocalFileUploadJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryLocalFileUploadJob(request: QueryLocalFileUploadJobRequest): QueryLocalFileUploadJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryLocalFileUploadJobWithOptions(request, runtime);
}

model QueryMonthRecordRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='VrJwPGjC1sJlqPjZA3cxg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y****'),
  month?: string(name='Month', example='201901'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model QueryMonthRecordResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='110111111011111001111100111110'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryMonthRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryMonthRecordResponseBody(name='body'),
}

async function queryMonthRecordWithOptions(request: QueryMonthRecordRequest, runtime: Util.RuntimeOptions): QueryMonthRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.month)) {
    query['Month'] = request.month;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryMonthRecord',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMonthRecord(request: QueryMonthRecordRequest): QueryMonthRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMonthRecordWithOptions(request, runtime);
}

model QueryPictureFilesRequest {
  beginTime?: long(name='BeginTime', example='1615357669000'),
  currentPage?: int32(name='CurrentPage', example='1'),
  deviceName?: string(name='DeviceName', example='camera1'),
  endTime?: long(name='EndTime', example='1615444063000'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y****'),
  pageSize?: int32(name='PageSize', example='10'),
  pictureSource?: int32(name='PictureSource', example='0'),
  pictureType?: int32(name='PictureType', example='2'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model QueryPictureFilesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
        picCreateTime?: long(name='PicCreateTime', example='1543458157522'),
        picId?: string(name='PicId', example='pZJUqijOyfpFOOGNP******'),
        picUrl?: string(name='PicUrl', example='http://***_normal.jpg'),
        thumbUrl?: string(name='ThumbUrl', example='http://***.jpg'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='product is not active.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryPictureFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPictureFilesResponseBody(name='body'),
}

async function queryPictureFilesWithOptions(request: QueryPictureFilesRequest, runtime: Util.RuntimeOptions): QueryPictureFilesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.pictureSource)) {
    query['PictureSource'] = request.pictureSource;
  }
  if (!Util.isUnset(request.pictureType)) {
    query['PictureType'] = request.pictureType;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPictureFiles',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPictureFiles(request: QueryPictureFilesRequest): QueryPictureFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPictureFilesWithOptions(request, runtime);
}

model QueryPictureSearchAiboxesRequest {
  appInstanceId?: string(name='AppInstanceId', example='5a502d3fbab8410e8fd4be9037c7****'),
  currentPage?: int32(name='CurrentPage', example='1'),
  iotInstanceId?: string(name='IotInstanceId', example='iot_instc_pu****_c*-v64********'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryPictureSearchAiboxesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        iotId?: string(name='IotId', example='VrJwPGjC1sJlqPjZA3cxg4****'),
        nickName?: string(name='NickName', example='box015'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified parameter CurrentPage is not valid.'),
  requestId?: string(name='RequestId', example='DF7DC571-FE48-4C25-8BE0-B13C3038C85B'),
  success?: boolean(name='Success', example='true'),
}

model QueryPictureSearchAiboxesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPictureSearchAiboxesResponseBody(name='body'),
}

async function queryPictureSearchAiboxesWithOptions(request: QueryPictureSearchAiboxesRequest, runtime: Util.RuntimeOptions): QueryPictureSearchAiboxesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPictureSearchAiboxes',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPictureSearchAiboxes(request: QueryPictureSearchAiboxesRequest): QueryPictureSearchAiboxesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPictureSearchAiboxesWithOptions(request, runtime);
}

model QueryPictureSearchAppsRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  iotInstanceId?: string(name='IotInstanceId', example='iot_instc_pu****_c*-v64********'),
  pageSize?: int32(name='PageSize', example='20'),
}

model QueryPictureSearchAppsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        appInstanceId?: string(name='AppInstanceId', example='3e429560124b44b685095df81a27****'),
        appTemplateId?: string(name='AppTemplateId', example='7b50e7acb2574a789226099300cc****'),
        createTime?: long(name='CreateTime', example='1614327915000'),
        description?: string(name='Description'),
        modifiedTime?: long(name='ModifiedTime', example='1614328081000'),
        name?: string(name='Name'),
        version?: string(name='Version', example='1.0.0'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='20'),
    total?: int32(name='Total', example='2'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified parameter CurrentPage is not valid.'),
  requestId?: string(name='RequestId', example='2C794BB1-0494-4E4E-AACF-174F04CD1F10'),
  success?: boolean(name='Success', example='true'),
}

model QueryPictureSearchAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPictureSearchAppsResponseBody(name='body'),
}

async function queryPictureSearchAppsWithOptions(request: QueryPictureSearchAppsRequest, runtime: Util.RuntimeOptions): QueryPictureSearchAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPictureSearchApps',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPictureSearchApps(request: QueryPictureSearchAppsRequest): QueryPictureSearchAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPictureSearchAppsWithOptions(request, runtime);
}

model QueryPictureSearchDevicesRequest {
  appInstanceId?: string(name='AppInstanceId', example='5a502d3fbab8410e8fd4be9037c7****'),
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryPictureSearchDevicesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        iotId?: string(name='IotId', example='VrJwPGjC1sJlqPjZA3cxg4****'),
        nickName?: string(name='NickName', example='camera1'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified parameter CurrentPage is not valid.'),
  requestId?: string(name='RequestId', example='DF7DC571-FE48-4C25-8BE0-B13C3038C85B'),
  success?: boolean(name='Success', example='true'),
}

model QueryPictureSearchDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPictureSearchDevicesResponseBody(name='body'),
}

async function queryPictureSearchDevicesWithOptions(request: QueryPictureSearchDevicesRequest, runtime: Util.RuntimeOptions): QueryPictureSearchDevicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPictureSearchDevices',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPictureSearchDevices(request: QueryPictureSearchDevicesRequest): QueryPictureSearchDevicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPictureSearchDevicesWithOptions(request, runtime);
}

model QueryPictureSearchJobRequest {
  appInstanceId?: string(name='AppInstanceId', example='fdc576d03c094faea9fa10fbf48c****'),
  currentPage?: int32(name='CurrentPage', example='1'),
  jobStatus?: int32(name='JobStatus', example='3'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryPictureSearchJobResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        createTime?: long(name='CreateTime', example='1614850763000'),
        endTime?: long(name='EndTime', example='1614850763692'),
        jobId?: string(name='JobId', example='b3786935a71442efae014c7b2212****'),
        jobStatus?: int32(name='JobStatus', example='3'),
        searchPicUrl?: string(name='SearchPicUrl', example='http://xxx.xxx.com/1.jpg'),
        startTime?: long(name='StartTime', example='1614814763692'),
        threshold?: float(name='Threshold', example='0.5'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='2'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Specified access key is not found.'),
  requestId?: string(name='RequestId', example='8FAF4001-2A53-46DF-B83E-306B8070E131'),
  success?: boolean(name='Success', example='true'),
}

model QueryPictureSearchJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPictureSearchJobResponseBody(name='body'),
}

async function queryPictureSearchJobWithOptions(request: QueryPictureSearchJobRequest, runtime: Util.RuntimeOptions): QueryPictureSearchJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.jobStatus)) {
    query['JobStatus'] = request.jobStatus;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPictureSearchJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPictureSearchJob(request: QueryPictureSearchJobRequest): QueryPictureSearchJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPictureSearchJobWithOptions(request, runtime);
}

model QueryPictureSearchJobResultRequest {
  appInstanceId?: string(name='AppInstanceId', example='fdc576d03c094faea9fa10fbf48c****'),
  currentPage?: int32(name='CurrentPage', example='1'),
  jobId?: string(name='JobId', example='b7e501d0d2524a4caeb50df3282a****'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryPictureSearchJobResultResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageData?: [ 
      {
        deviceNickName?: string(name='DeviceNickName', example='camera1'),
        eventTime?: long(name='EventTime', example='1614333155075'),
        gatewayIotId?: string(name='GatewayIotId', example='pZJUqijOyfpFOOGNPF7S00****'),
        iotId?: string(name='IotId', example='5RUngwC1RknD4lPiHgH300****'),
        picUrl?: string(name='PicUrl', example='https://xxx.xxx.xxx.com/xxx'),
        threshold?: float(name='Threshold', example='0.5'),
        vectorId?: string(name='VectorId', example='vectorId86d9a5c32b9947278e526c2eef8a****'),
      }
    ](name='PageData'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='AppInstanceId is mandatory for this action.'),
  requestId?: string(name='RequestId', example='a06c4750-7cce-11eb-8010-557d50136505'),
  success?: boolean(name='Success', example='true'),
}

model QueryPictureSearchJobResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPictureSearchJobResultResponseBody(name='body'),
}

async function queryPictureSearchJobResultWithOptions(request: QueryPictureSearchJobResultRequest, runtime: Util.RuntimeOptions): QueryPictureSearchJobResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPictureSearchJobResult',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryPictureSearchJobResult(request: QueryPictureSearchJobResultRequest): QueryPictureSearchJobResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPictureSearchJobResultWithOptions(request, runtime);
}

model QueryRecordRequest {
  beginTime?: int32(name='BeginTime', example='1508200012'),
  currentPage?: int32(name='CurrentPage', example='1'),
  deviceName?: string(name='DeviceName', example='camera1'),
  endTime?: int32(name='EndTime', example='1582420940'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-060a****'),
  needSnapshot?: boolean(name='NeedSnapshot', example='true'),
  pageSize?: int32(name='PageSize', example='10'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  recordType?: int32(name='RecordType', example='1'),
  streamType?: int32(name='StreamType', example='1'),
}

model QueryRecordResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        beginTime?: string(name='BeginTime', example='2018-09-10 00:00:00'),
        endTime?: string(name='EndTime', example='2018-09-10 00:00:30'),
        eventType?: int32(name='EventType'),
        fileName?: string(name='FileName', example='file1'),
        fileSize?: int32(name='FileSize', example='204800'),
        recordType?: int32(name='RecordType', example='1'),
        snapshotUrl?: string(name='SnapshotUrl', example='https://lin****/****2Cq_90'),
        streamType?: int32(name='StreamType', example='1'),
        videoFrameNumber?: int32(name='VideoFrameNumber', example='1352'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordResponseBody(name='body'),
}

async function queryRecordWithOptions(request: QueryRecordRequest, runtime: Util.RuntimeOptions): QueryRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.needSnapshot)) {
    query['NeedSnapshot'] = request.needSnapshot;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.recordType)) {
    query['RecordType'] = request.recordType;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecord',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecord(request: QueryRecordRequest): QueryRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordWithOptions(request, runtime);
}

model QueryRecordByRecordIdRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-060a01****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  recordId?: string(name='RecordId', example='2c5bf5b6a8704bd3a6a1517fd125****'),
}

model QueryRecordByRecordIdResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      beginTime?: string(name='BeginTime', example='2020-10-12 14:07:20'),
      endTime?: string(name='EndTime', example='2020-10-12 14:07:31'),
      fileName?: string(name='FileName', example='test'),
      vodUrl?: string(name='VodUrl', example='https://iotx-vision-vod-vpc-hz-pre.aliyun-inc.com/vod/device/localrecord/flv/play/1****668.flv?token=e9****a9e14482c56be52&session=470e****3d015'),
    }
  ](name='Data'),
  errorMessage?: string(name='ErrorMessage', example='RecordId is mandatory for this action.'),
  requestId?: string(name='RequestId', example='F46E12A5-633D-4761-80F2-285752A052D5'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordByRecordIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordByRecordIdResponseBody(name='body'),
}

async function queryRecordByRecordIdWithOptions(request: QueryRecordByRecordIdRequest, runtime: Util.RuntimeOptions): QueryRecordByRecordIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordByRecordId',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordByRecordId(request: QueryRecordByRecordIdRequest): QueryRecordByRecordIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordByRecordIdWithOptions(request, runtime);
}

model QueryRecordDownloadJobByIdRequest {
  iotInstanceId?: string(name='IotInstanceId', example='Iot-r******'),
  jobId?: string(name='JobId', example='w2s******'),
}

model QueryRecordDownloadJobByIdResponseBody = {
  code?: string(name='Code', example='400'),
  data?: {
    beginTime?: int32(name='BeginTime', example='1900000000'),
    endTime?: int32(name='EndTime', example='2100000000'),
    fileName?: string(name='FileName', example='testfile'),
    iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
    jobErrorCode?: int32(name='JobErrorCode', example='9441'),
    progress?: int32(name='Progress', example='90'),
    recordType?: int32(name='RecordType', example='0'),
    status?: int32(name='Status', example='-1'),
    streamType?: int32(name='StreamType', example='0'),
    type?: int32(name='Type', example='1'),
    url?: string(name='Url', example='http://*********'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='Request failed.'),
  requestId?: string(name='RequestId', example='E55***B7-4***-4***-8***-D3******F565'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordDownloadJobByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordDownloadJobByIdResponseBody(name='body'),
}

async function queryRecordDownloadJobByIdWithOptions(request: QueryRecordDownloadJobByIdRequest, runtime: Util.RuntimeOptions): QueryRecordDownloadJobByIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordDownloadJobById',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordDownloadJobById(request: QueryRecordDownloadJobByIdRequest): QueryRecordDownloadJobByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordDownloadJobByIdWithOptions(request, runtime);
}

model QueryRecordDownloadJobListRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  deviceName?: string(name='DeviceName', example='Device01'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-2w******'),
  pageSize?: int32(name='PageSize', example='1'),
  productKey?: string(name='ProductKey', example='a1Bw******'),
}

model QueryRecordDownloadJobListResponseBody = {
  code?: string(name='Code', example='400'),
  data?: {
    jobList?: [ 
      {
        beginTime?: int32(name='BeginTime', example='1900000000'),
        endTime?: int32(name='EndTime', example='2100000000'),
        fileName?: string(name='FileName', example='testfile'),
        iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
        jobErrorCode?: int32(name='JobErrorCode', example='9441'),
        jobId?: string(name='JobId', example='w2s******'),
        progress?: int32(name='Progress', example='90'),
        recordType?: int32(name='RecordType', example='0'),
        status?: int32(name='Status', example='-1'),
        streamType?: int32(name='StreamType', example='0'),
        type?: int32(name='Type', example='1'),
        url?: string(name='Url', example='http://*********'),
      }
    ](name='JobList'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='iot.vision.RequestFailed'),
  requestId?: string(name='RequestId', example='E55***B7-4***-4***-8***-D3******F565'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordDownloadJobListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordDownloadJobListResponseBody(name='body'),
}

async function queryRecordDownloadJobListWithOptions(request: QueryRecordDownloadJobListRequest, runtime: Util.RuntimeOptions): QueryRecordDownloadJobListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordDownloadJobList',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordDownloadJobList(request: QueryRecordDownloadJobListRequest): QueryRecordDownloadJobListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordDownloadJobListWithOptions(request, runtime);
}

model QueryRecordDownloadUrlRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  fileName?: string(name='FileName', example='1623999491_LYPsmZGeEN8GdKzMtYNiBXXXXXXXXX_0/c0064411-2065-400a-a13e-********'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWR****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model QueryRecordDownloadUrlResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    progress?: int32(name='Progress', example='0'),
    status?: int32(name='Status', example='0'),
    url?: string(name='Url', example='https://link-vision-storage-online.oss-cn-shanghai.aliyuncs.com/transcode%2Fgk-********.mp4?OSSAccessKeyId=LTA*****TTTTTTTT&Expires=16****804&Signature=****'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='XXX is mandatory for this action'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordDownloadUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordDownloadUrlResponseBody(name='body'),
}

async function queryRecordDownloadUrlWithOptions(request: QueryRecordDownloadUrlRequest, runtime: Util.RuntimeOptions): QueryRecordDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordDownloadUrl',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordDownloadUrl(request: QueryRecordDownloadUrlRequest): QueryRecordDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordDownloadUrlWithOptions(request, runtime);
}

model QueryRecordPlanDetailRequest {
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
}

model QueryRecordPlanDetailResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    name?: string(name='Name', example='test'),
    planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
    templateId?: string(name='TemplateId', example='693e244a038f4255bb2f5db32874****'),
    templateInfo?: {
      allDay?: int32(name='AllDay', example='1'),
      default?: int32(name='Default', example='1'),
      name?: string(name='Name', example='test'),
      templateId?: string(name='TemplateId', example='693e244a038f4255bb2f5db32874****'),
      timeSectionList?: [ 
        {
          begin?: int32(name='Begin', example='6000'),
          dayOfWeek?: int32(name='DayOfWeek', example='0'),
          end?: int32(name='End', example='20000'),
        }
      ](name='TimeSectionList'),
    }(name='TemplateInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordPlanDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordPlanDetailResponseBody(name='body'),
}

async function queryRecordPlanDetailWithOptions(request: QueryRecordPlanDetailRequest, runtime: Util.RuntimeOptions): QueryRecordPlanDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordPlanDetail',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordPlanDetail(request: QueryRecordPlanDetailRequest): QueryRecordPlanDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordPlanDetailWithOptions(request, runtime);
}

model QueryRecordPlanDeviceByDeviceRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model QueryRecordPlanDeviceByDeviceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    name?: string(name='Name', example='test'),
    planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
    templateId?: string(name='TemplateId', example='693e244a038f4255bb2f5db32874****'),
    templateInfo?: {
      allDay?: int32(name='AllDay', example='1'),
      default?: int32(name='Default', example='0'),
      name?: string(name='Name', example='test'),
      templateId?: string(name='TemplateId', example='693e244a038f4255bb2f5db32874****'),
      timeSectionList?: [ 
        {
          begin?: int32(name='Begin', example='6000'),
          dayOfWeek?: int32(name='DayOfWeek', example='0'),
          end?: int32(name='End', example='20000'),
        }
      ](name='TimeSectionList'),
    }(name='TemplateInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordPlanDeviceByDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordPlanDeviceByDeviceResponseBody(name='body'),
}

async function queryRecordPlanDeviceByDeviceWithOptions(request: QueryRecordPlanDeviceByDeviceRequest, runtime: Util.RuntimeOptions): QueryRecordPlanDeviceByDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordPlanDeviceByDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordPlanDeviceByDevice(request: QueryRecordPlanDeviceByDeviceRequest): QueryRecordPlanDeviceByDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordPlanDeviceByDeviceWithOptions(request, runtime);
}

model QueryRecordPlanDeviceByPlanRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
}

model QueryRecordPlanDeviceByPlanResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
        streamType?: int32(name='StreamType', example='1'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordPlanDeviceByPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordPlanDeviceByPlanResponseBody(name='body'),
}

async function queryRecordPlanDeviceByPlanWithOptions(request: QueryRecordPlanDeviceByPlanRequest, runtime: Util.RuntimeOptions): QueryRecordPlanDeviceByPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordPlanDeviceByPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordPlanDeviceByPlan(request: QueryRecordPlanDeviceByPlanRequest): QueryRecordPlanDeviceByPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordPlanDeviceByPlanWithOptions(request, runtime);
}

model QueryRecordPlansRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryRecordPlansResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        name?: string(name='Name', example='plan1'),
        planId?: string(name='PlanId', example='6c5a397bc17c4b48ace86f0f0c30****'),
        templateId?: string(name='TemplateId', example='693e244a038f4255bb2f5db32874****'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='2'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordPlansResponseBody(name='body'),
}

async function queryRecordPlansWithOptions(request: QueryRecordPlansRequest, runtime: Util.RuntimeOptions): QueryRecordPlansResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordPlans',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordPlans(request: QueryRecordPlansRequest): QueryRecordPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordPlansWithOptions(request, runtime);
}

model QueryRecordUrlRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  fileName?: string(name='FileName', example='file1'),
  iotId?: string(name='IotId', example='VrJwPGjC1sJlqPjZA3cxg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  seekTime?: int32(name='SeekTime', example='0'),
  urlValidDuration?: int32(name='UrlValidDuration', example='10'),
}

model QueryRecordUrlResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='https://linkvisual.aliyun.com/ddsffa****.m3u8'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordUrlResponseBody(name='body'),
}

async function queryRecordUrlWithOptions(request: QueryRecordUrlRequest, runtime: Util.RuntimeOptions): QueryRecordUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.seekTime)) {
    query['SeekTime'] = request.seekTime;
  }
  if (!Util.isUnset(request.urlValidDuration)) {
    query['UrlValidDuration'] = request.urlValidDuration;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordUrl',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordUrl(request: QueryRecordUrlRequest): QueryRecordUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordUrlWithOptions(request, runtime);
}

model QueryRecordUrlByTimeRequest {
  beginTime?: int32(name='BeginTime', example='1638675381'),
  deviceName?: string(name='DeviceName', example='camera1'),
  endTime?: int32(name='EndTime', example='1638866820'),
  iotId?: string(name='IotId', example='d7XmBoJhAr88C6PelXDF00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-060a****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
  urlValidDuration?: int32(name='UrlValidDuration', example='200'),
}

model QueryRecordUrlByTimeResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='https://linkvisual.aliyun.com/ddsffa****.m3u8'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryRecordUrlByTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordUrlByTimeResponseBody(name='body'),
}

async function queryRecordUrlByTimeWithOptions(request: QueryRecordUrlByTimeRequest, runtime: Util.RuntimeOptions): QueryRecordUrlByTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  if (!Util.isUnset(request.urlValidDuration)) {
    query['UrlValidDuration'] = request.urlValidDuration;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordUrlByTime',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRecordUrlByTime(request: QueryRecordUrlByTimeRequest): QueryRecordUrlByTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordUrlByTimeWithOptions(request, runtime);
}

model QueryRtmpKeyRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model QueryRtmpKeyResponseBody = {
  code?: string(name='Code'),
  data?: {
    pullAuthKey?: string(name='PullAuthKey'),
    pullKeyExpireTime?: int32(name='PullKeyExpireTime'),
    pushAuthKey?: string(name='PushAuthKey'),
    pushKeyExpireTime?: int32(name='PushKeyExpireTime'),
    streamName?: string(name='StreamName'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryRtmpKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRtmpKeyResponseBody(name='body'),
}

async function queryRtmpKeyWithOptions(request: QueryRtmpKeyRequest, runtime: Util.RuntimeOptions): QueryRtmpKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRtmpKey',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRtmpKey(request: QueryRtmpKeyRequest): QueryRtmpKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRtmpKeyWithOptions(request, runtime);
}

model QueryStreamPushJobRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  jobId?: string(name='JobId'),
  productKey?: string(name='ProductKey'),
}

model QueryStreamPushJobResponseBody = {
  code?: string(name='Code'),
  data?: {
    createTime?: int32(name='CreateTime'),
    jobType?: int32(name='JobType'),
    pushStatus?: int32(name='PushStatus'),
    pushUrl?: string(name='PushUrl'),
    streamType?: int32(name='StreamType'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryStreamPushJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryStreamPushJobResponseBody(name='body'),
}

async function queryStreamPushJobWithOptions(request: QueryStreamPushJobRequest, runtime: Util.RuntimeOptions): QueryStreamPushJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryStreamPushJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryStreamPushJob(request: QueryStreamPushJobRequest): QueryStreamPushJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryStreamPushJobWithOptions(request, runtime);
}

model QueryStreamPushJobListRequest {
  currentPage?: int32(name='CurrentPage'),
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  jobType?: int32(name='JobType'),
  pageSize?: int32(name='PageSize'),
  productKey?: string(name='ProductKey'),
}

model QueryStreamPushJobListResponseBody = {
  code?: string(name='Code'),
  data?: {
    jobList?: [ 
      {
        createTime?: int32(name='CreateTime'),
        jobId?: string(name='JobId'),
        jobType?: int32(name='JobType'),
        pushStatus?: int32(name='PushStatus'),
        pushUrl?: string(name='PushUrl'),
        streamType?: int32(name='StreamType'),
      }
    ](name='JobList'),
    total?: int32(name='Total'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryStreamPushJobListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryStreamPushJobListResponseBody(name='body'),
}

async function queryStreamPushJobListWithOptions(request: QueryStreamPushJobListRequest, runtime: Util.RuntimeOptions): QueryStreamPushJobListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.jobType)) {
    query['JobType'] = request.jobType;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryStreamPushJobList',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryStreamPushJobList(request: QueryStreamPushJobListRequest): QueryStreamPushJobListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryStreamPushJobListWithOptions(request, runtime);
}

model QueryStreamSnapshotJobRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model QueryStreamSnapshotJobResponseBody = {
  code?: string(name='Code'),
  data?: {
    jobList?: [ 
      {
        snapshotInterval?: int32(name='SnapshotInterval'),
        streamType?: int32(name='StreamType'),
      }
    ](name='JobList'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryStreamSnapshotJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryStreamSnapshotJobResponseBody(name='body'),
}

async function queryStreamSnapshotJobWithOptions(request: QueryStreamSnapshotJobRequest, runtime: Util.RuntimeOptions): QueryStreamSnapshotJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryStreamSnapshotJob',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryStreamSnapshotJob(request: QueryStreamSnapshotJobRequest): QueryStreamSnapshotJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryStreamSnapshotJobWithOptions(request, runtime);
}

model QueryTimeTemplateRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryTimeTemplateResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    list?: [ 
      {
        allDay?: int32(name='AllDay', example='1'),
        default?: int32(name='Default', example='1'),
        name?: string(name='Name', example='exampleName'),
        templateId?: string(name='TemplateId', example='adxxx'),
        timeSectionList?: [ 
          {
            begin?: int32(name='Begin', example='20000'),
            dayOfWeek?: int32(name='DayOfWeek', example='0'),
            end?: int32(name='End', example='60000'),
          }
        ](name='TimeSectionList'),
      }
    ](name='List'),
    page?: int32(name='Page', example='1'),
    pageCount?: int32(name='PageCount', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryTimeTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTimeTemplateResponseBody(name='body'),
}

async function queryTimeTemplateWithOptions(request: QueryTimeTemplateRequest, runtime: Util.RuntimeOptions): QueryTimeTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTimeTemplate',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTimeTemplate(request: QueryTimeTemplateRequest): QueryTimeTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTimeTemplateWithOptions(request, runtime);
}

model QueryTimeTemplateDetailRequest {
  templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
}

model QueryTimeTemplateDetailResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    allDay?: int32(name='AllDay', example='0'),
    default?: int32(name='Default', example='1'),
    name?: string(name='Name', example='test'),
    templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
    timeSectionList?: [ 
      {
        begin?: int32(name='Begin', example='20000'),
        dayOfWeek?: int32(name='DayOfWeek', example='0'),
        end?: int32(name='End', example='60000'),
      }
    ](name='TimeSectionList'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='template owner error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryTimeTemplateDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTimeTemplateDetailResponseBody(name='body'),
}

async function queryTimeTemplateDetailWithOptions(request: QueryTimeTemplateDetailRequest, runtime: Util.RuntimeOptions): QueryTimeTemplateDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTimeTemplateDetail',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTimeTemplateDetail(request: QueryTimeTemplateDetailRequest): QueryTimeTemplateDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTimeTemplateDetailWithOptions(request, runtime);
}

model QueryVisionDeviceInfoRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model QueryVisionDeviceInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    description?: string(name='Description'),
    deviceType?: int32(name='DeviceType'),
    gbDeviceInfo?: {
      deviceProtocol?: int32(name='DeviceProtocol'),
      gbId?: string(name='GbId'),
      netProtocol?: int32(name='NetProtocol'),
      nickName?: string(name='NickName'),
      password?: string(name='Password'),
      subProductKey?: string(name='SubProductKey'),
    }(name='GbDeviceInfo'),
    rtmpDeviceInfo?: {
      pullAuthKey?: string(name='PullAuthKey'),
      pullKeyExpireTime?: int32(name='PullKeyExpireTime'),
      pushAuthKey?: string(name='PushAuthKey'),
      pushKeyExpireTime?: int32(name='PushKeyExpireTime'),
      pushUrlSample?: string(name='PushUrlSample'),
      streamName?: string(name='StreamName'),
      streamStatus?: int32(name='StreamStatus'),
    }(name='RtmpDeviceInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryVisionDeviceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVisionDeviceInfoResponseBody(name='body'),
}

async function queryVisionDeviceInfoWithOptions(request: QueryVisionDeviceInfoRequest, runtime: Util.RuntimeOptions): QueryVisionDeviceInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVisionDeviceInfo',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryVisionDeviceInfo(request: QueryVisionDeviceInfoRequest): QueryVisionDeviceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVisionDeviceInfoWithOptions(request, runtime);
}

model QueryVoiceIntercomRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y*****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  scheme?: string(name='Scheme'),
}

model QueryVoiceIntercomResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    cryptoKey?: {
      iv?: string(name='Iv', example='MDEyMzQ1Njc4********0+Pw=='),
      key?: string(name='Key', example='bPvz6tnfonP1E+********v2Q=='),
    }(name='CryptoKey'),
    url?: string(name='Url', example='rtmp://106.15.xxx.xxx:8000/talk?token=xxxxxxx'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model QueryVoiceIntercomResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVoiceIntercomResponseBody(name='body'),
}

async function queryVoiceIntercomWithOptions(request: QueryVoiceIntercomRequest, runtime: Util.RuntimeOptions): QueryVoiceIntercomResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.scheme)) {
    query['Scheme'] = request.scheme;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVoiceIntercom',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryVoiceIntercom(request: QueryVoiceIntercomRequest): QueryVoiceIntercomResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVoiceIntercomWithOptions(request, runtime);
}

model RefreshGbSubDeviceListRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
}

model RefreshGbSubDeviceListResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RefreshGbSubDeviceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshGbSubDeviceListResponseBody(name='body'),
}

async function refreshGbSubDeviceListWithOptions(request: RefreshGbSubDeviceListRequest, runtime: Util.RuntimeOptions): RefreshGbSubDeviceListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefreshGbSubDeviceList',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refreshGbSubDeviceList(request: RefreshGbSubDeviceListRequest): RefreshGbSubDeviceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshGbSubDeviceListWithOptions(request, runtime);
}

model RemoveFaceDeviceFromDeviceGroupRequest {
  deviceGroupId?: string(name='DeviceGroupId', example='TestDeviceGroupId'),
  deviceName?: string(name='DeviceName', example='TestDeviceName'),
  iotInstanceId?: string(name='IotInstanceId', example='TestIotInstanceId'),
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  productKey?: string(name='ProductKey', example='TestProductKey'),
}

model RemoveFaceDeviceFromDeviceGroupResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model RemoveFaceDeviceFromDeviceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveFaceDeviceFromDeviceGroupResponseBody(name='body'),
}

async function removeFaceDeviceFromDeviceGroupWithOptions(request: RemoveFaceDeviceFromDeviceGroupRequest, runtime: Util.RuntimeOptions): RemoveFaceDeviceFromDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveFaceDeviceFromDeviceGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeFaceDeviceFromDeviceGroup(request: RemoveFaceDeviceFromDeviceGroupRequest): RemoveFaceDeviceFromDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeFaceDeviceFromDeviceGroupWithOptions(request, runtime);
}

model RemoveFaceUserFromUserGroupRequest {
  isolationId?: string(name='IsolationId', example='TestIsolationId'),
  userGroupId?: string(name='UserGroupId', example='TestUserGroupId'),
  userId?: string(name='UserId', example='TestUserId'),
}

model RemoveFaceUserFromUserGroupResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model RemoveFaceUserFromUserGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveFaceUserFromUserGroupResponseBody(name='body'),
}

async function removeFaceUserFromUserGroupWithOptions(request: RemoveFaceUserFromUserGroupRequest, runtime: Util.RuntimeOptions): RemoveFaceUserFromUserGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.userGroupId)) {
    query['UserGroupId'] = request.userGroupId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveFaceUserFromUserGroup',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeFaceUserFromUserGroup(request: RemoveFaceUserFromUserGroupRequest): RemoveFaceUserFromUserGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeFaceUserFromUserGroupWithOptions(request, runtime);
}

model SetDevicePictureLifeCycleRequest {
  day?: int32(name='Day', example='7'),
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHR****c300'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model SetDevicePictureLifeCycleResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='449ECE75-A36A-4ACE-B253-147C78C440C5'),
  success?: boolean(name='Success', example='true'),
}

model SetDevicePictureLifeCycleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetDevicePictureLifeCycleResponseBody(name='body'),
}

async function setDevicePictureLifeCycleWithOptions(request: SetDevicePictureLifeCycleRequest, runtime: Util.RuntimeOptions): SetDevicePictureLifeCycleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.day)) {
    query['Day'] = request.day;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetDevicePictureLifeCycle',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setDevicePictureLifeCycle(request: SetDevicePictureLifeCycleRequest): SetDevicePictureLifeCycleResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDevicePictureLifeCycleWithOptions(request, runtime);
}

model SetDeviceRecordLifeCycleRequest {
  day?: int32(name='Day', example='7'),
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='d7XmBoJhAr88C6PelXDF00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model SetDeviceRecordLifeCycleResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='InvalidParameter'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model SetDeviceRecordLifeCycleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetDeviceRecordLifeCycleResponseBody(name='body'),
}

async function setDeviceRecordLifeCycleWithOptions(request: SetDeviceRecordLifeCycleRequest, runtime: Util.RuntimeOptions): SetDeviceRecordLifeCycleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.day)) {
    query['Day'] = request.day;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetDeviceRecordLifeCycle',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setDeviceRecordLifeCycle(request: SetDeviceRecordLifeCycleRequest): SetDeviceRecordLifeCycleResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDeviceRecordLifeCycleWithOptions(request, runtime);
}

model StopLiveStreamingRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  streamType?: int32(name='StreamType', example='0'),
}

model StopLiveStreamingResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model StopLiveStreamingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopLiveStreamingResponseBody(name='body'),
}

async function stopLiveStreamingWithOptions(request: StopLiveStreamingRequest, runtime: Util.RuntimeOptions): StopLiveStreamingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopLiveStreaming',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopLiveStreaming(request: StopLiveStreamingRequest): StopLiveStreamingResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopLiveStreamingWithOptions(request, runtime);
}

model StopTriggeredRecordRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='C47T6xwp6ms4bNlkHRWCg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  recordId?: string(name='RecordId', example='fc82774fa749485bad7d719f9670****'),
}

model StopTriggeredRecordResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model StopTriggeredRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopTriggeredRecordResponseBody(name='body'),
}

async function stopTriggeredRecordWithOptions(request: StopTriggeredRecordRequest, runtime: Util.RuntimeOptions): StopTriggeredRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopTriggeredRecord',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopTriggeredRecord(request: StopTriggeredRecordRequest): StopTriggeredRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopTriggeredRecordWithOptions(request, runtime);
}

model TransferDeviceInstanceRequest {
  deviceNameList?: [ string ](name='DeviceNameList', example='RepeatList'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  sourceInstanceId?: string(name='SourceInstanceId', example='iotx-oxssharez200'),
  targetInstanceId?: string(name='TargetInstanceId', example='iot-060***'),
}

model TransferDeviceInstanceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    failedList?: [ 
      {
        deviceName?: string(name='DeviceName', example='e5jdfalekj****'),
        message?: string(name='Message'),
      }
    ](name='FailedList'),
    successList?: [ 
      {
        deviceName?: string(name='DeviceName', example='e598798j****'),
        message?: string(name='Message', example='success'),
      }
    ](name='SuccessList'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId', example='27AF2E38-12ED-4F67-BD20-36E812CD7A42'),
  success?: boolean(name='Success', example='true'),
}

model TransferDeviceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransferDeviceInstanceResponseBody(name='body'),
}

async function transferDeviceInstanceWithOptions(request: TransferDeviceInstanceRequest, runtime: Util.RuntimeOptions): TransferDeviceInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceNameList)) {
    query['DeviceNameList'] = request.deviceNameList;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.sourceInstanceId)) {
    query['SourceInstanceId'] = request.sourceInstanceId;
  }
  if (!Util.isUnset(request.targetInstanceId)) {
    query['TargetInstanceId'] = request.targetInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransferDeviceInstance',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function transferDeviceInstance(request: TransferDeviceInstanceRequest): TransferDeviceInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return transferDeviceInstanceWithOptions(request, runtime);
}

model TriggerCapturePictureRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa9hsPyD00****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
}

model TriggerCapturePictureResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='eventPicId_12****'),
  errorMessage?: string(name='ErrorMessage', example='request forbidden'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model TriggerCapturePictureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TriggerCapturePictureResponseBody(name='body'),
}

async function triggerCapturePictureWithOptions(request: TriggerCapturePictureRequest, runtime: Util.RuntimeOptions): TriggerCapturePictureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TriggerCapturePicture',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function triggerCapturePicture(request: TriggerCapturePictureRequest): TriggerCapturePictureResponse {
  var runtime = new Util.RuntimeOptions{};
  return triggerCapturePictureWithOptions(request, runtime);
}

model TriggerRecordRequest {
  deviceName?: string(name='DeviceName', example='camera1'),
  iotId?: string(name='IotId', example='zLZyi6aOLyOSHa****yD000100'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y5****0t'),
  preRecordDuration?: int32(name='PreRecordDuration', example='5'),
  productKey?: string(name='ProductKey', example='a1BwAGV****'),
  recordDuration?: int32(name='RecordDuration', example='60'),
  streamType?: int32(name='StreamType', example='0'),
}

model TriggerRecordResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='fc82774fa749485bad7d719f9670****'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model TriggerRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TriggerRecordResponseBody(name='body'),
}

async function triggerRecordWithOptions(request: TriggerRecordRequest, runtime: Util.RuntimeOptions): TriggerRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.preRecordDuration)) {
    query['PreRecordDuration'] = request.preRecordDuration;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.recordDuration)) {
    query['RecordDuration'] = request.recordDuration;
  }
  if (!Util.isUnset(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TriggerRecord',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function triggerRecord(request: TriggerRecordRequest): TriggerRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return triggerRecordWithOptions(request, runtime);
}

model UnbindPictureSearchAppWithDevicesRequest {
  appInstanceId?: string(name='AppInstanceId', example='5a502d3fbab8410e8fd4be9037c7****'),
  deviceIotIds?: [ string ](name='DeviceIotIds', example='VrJwPGjC1sJlqPjZA3cxg4****'),
  iotInstanceId?: string(name='IotInstanceId', example='iot-060a****'),
}

model UnbindPictureSearchAppWithDevicesResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='iotIdList is error'),
  requestId?: string(name='RequestId', example='E779C673-E8E8-41F0-883E-7D9275DF733C'),
  success?: boolean(name='Success', example='true'),
}

model UnbindPictureSearchAppWithDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindPictureSearchAppWithDevicesResponseBody(name='body'),
}

async function unbindPictureSearchAppWithDevicesWithOptions(request: UnbindPictureSearchAppWithDevicesRequest, runtime: Util.RuntimeOptions): UnbindPictureSearchAppWithDevicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.deviceIotIds)) {
    query['DeviceIotIds'] = request.deviceIotIds;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindPictureSearchAppWithDevices',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindPictureSearchAppWithDevices(request: UnbindPictureSearchAppWithDevicesRequest): UnbindPictureSearchAppWithDevicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindPictureSearchAppWithDevicesWithOptions(request, runtime);
}

model UpdateEventRecordPlanRequest {
  eventTypes?: string(name='EventTypes', example='1'),
  name?: string(name='Name', example='record1'),
  planId?: string(name='PlanId', example='5b60bf0dd55944c19d7817442bc9****'),
  preRecordDuration?: int32(name='PreRecordDuration', example='10'),
  recordDuration?: int32(name='RecordDuration', example='30'),
  templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
}

model UpdateEventRecordPlanResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model UpdateEventRecordPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEventRecordPlanResponseBody(name='body'),
}

async function updateEventRecordPlanWithOptions(request: UpdateEventRecordPlanRequest, runtime: Util.RuntimeOptions): UpdateEventRecordPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eventTypes)) {
    query['EventTypes'] = request.eventTypes;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.preRecordDuration)) {
    query['PreRecordDuration'] = request.preRecordDuration;
  }
  if (!Util.isUnset(request.recordDuration)) {
    query['RecordDuration'] = request.recordDuration;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEventRecordPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateEventRecordPlan(request: UpdateEventRecordPlanRequest): UpdateEventRecordPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateEventRecordPlanWithOptions(request, runtime);
}

model UpdateFaceUserRequest {
  customUserId?: string(name='CustomUserId', example='52242819650301xxxx'),
  facePicUrl?: string(name='FacePicUrl', example='https://test.com/test.jpg'),
  isolationId?: string(name='IsolationId', example='TestIsolati****'),
  name?: string(name='Name', example='ZhangSan'),
  params?: string(name='Params', example='{"age":28, "sex":"male"}'),
  userId?: string(name='UserId', example='tibce3fsgqel****'),
}

model UpdateFaceUserResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model UpdateFaceUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFaceUserResponseBody(name='body'),
}

async function updateFaceUserWithOptions(request: UpdateFaceUserRequest, runtime: Util.RuntimeOptions): UpdateFaceUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customUserId)) {
    query['CustomUserId'] = request.customUserId;
  }
  if (!Util.isUnset(request.facePicUrl)) {
    query['FacePicUrl'] = request.facePicUrl;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.params)) {
    query['Params'] = request.params;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFaceUser',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFaceUser(request: UpdateFaceUserRequest): UpdateFaceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateFaceUserWithOptions(request, runtime);
}

model UpdateFaceUserGroupAndDeviceGroupRelationRequest {
  controlId?: string(name='ControlId', example='qcb2yea4ha4d****'),
  isolationId?: string(name='IsolationId', example='ZheJiangHZ'),
  relation?: string(name='Relation', example='SYNC_INFO_PICTURE'),
}

model UpdateFaceUserGroupAndDeviceGroupRelationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    controlId?: string(name='ControlId', example='qcb2yea4ha4d****'),
    modifiedTime?: string(name='ModifiedTime', example='2020-04-25 19:29:30'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='access control not exist'),
  requestId?: string(name='RequestId', example='0A13279A-5640-45E7-87AA-83750541AD0E'),
  success?: boolean(name='Success', example='true'),
}

model UpdateFaceUserGroupAndDeviceGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFaceUserGroupAndDeviceGroupRelationResponseBody(name='body'),
}

async function updateFaceUserGroupAndDeviceGroupRelationWithOptions(request: UpdateFaceUserGroupAndDeviceGroupRelationRequest, runtime: Util.RuntimeOptions): UpdateFaceUserGroupAndDeviceGroupRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.controlId)) {
    query['ControlId'] = request.controlId;
  }
  if (!Util.isUnset(request.isolationId)) {
    query['IsolationId'] = request.isolationId;
  }
  if (!Util.isUnset(request.relation)) {
    query['Relation'] = request.relation;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFaceUserGroupAndDeviceGroupRelation',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFaceUserGroupAndDeviceGroupRelation(request: UpdateFaceUserGroupAndDeviceGroupRelationRequest): UpdateFaceUserGroupAndDeviceGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateFaceUserGroupAndDeviceGroupRelationWithOptions(request, runtime);
}

model UpdateGbDeviceRequest {
  description?: string(name='Description'),
  deviceName?: string(name='DeviceName'),
  gbId?: string(name='GbId'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  password?: string(name='Password'),
  productKey?: string(name='ProductKey'),
}

model UpdateGbDeviceResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateGbDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateGbDeviceResponseBody(name='body'),
}

async function updateGbDeviceWithOptions(request: UpdateGbDeviceRequest, runtime: Util.RuntimeOptions): UpdateGbDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.gbId)) {
    query['GbId'] = request.gbId;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGbDevice',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGbDevice(request: UpdateGbDeviceRequest): UpdateGbDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGbDeviceWithOptions(request, runtime);
}

model UpdateInstanceInternetProtocolRequest {
  iotInstanceId?: string(name='IotInstanceId', example='iot-cn-n6w1y59****'),
  ipVersion?: string(name='IpVersion', example='IPv4'),
}

model UpdateInstanceInternetProtocolResponseBody = {
  code?: string(name='Code', example='200'),
  data?: map[string]any(name='Data'),
  errorMessage?: string(name='ErrorMessage', example='InvalidParameter'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model UpdateInstanceInternetProtocolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceInternetProtocolResponseBody(name='body'),
}

async function updateInstanceInternetProtocolWithOptions(request: UpdateInstanceInternetProtocolRequest, runtime: Util.RuntimeOptions): UpdateInstanceInternetProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.ipVersion)) {
    query['IpVersion'] = request.ipVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstanceInternetProtocol',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateInstanceInternetProtocol(request: UpdateInstanceInternetProtocolRequest): UpdateInstanceInternetProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceInternetProtocolWithOptions(request, runtime);
}

model UpdatePictureSearchAppRequest {
  appInstanceId?: string(name='AppInstanceId', example='3e429560124b44b685095df81a27****'),
  description?: string(name='Description'),
  name?: string(name='Name'),
}

model UpdatePictureSearchAppResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='Description is mandatory for this action.'),
  requestId?: string(name='RequestId', example='CC6B9D69-627C-4C9D-AEAA-0BC08AB6DBED'),
  success?: boolean(name='Success', example='true'),
}

model UpdatePictureSearchAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePictureSearchAppResponseBody(name='body'),
}

async function updatePictureSearchAppWithOptions(request: UpdatePictureSearchAppRequest, runtime: Util.RuntimeOptions): UpdatePictureSearchAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appInstanceId)) {
    query['AppInstanceId'] = request.appInstanceId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePictureSearchApp',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updatePictureSearchApp(request: UpdatePictureSearchAppRequest): UpdatePictureSearchAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePictureSearchAppWithOptions(request, runtime);
}

model UpdateRecordPlanRequest {
  name?: string(name='Name', example='test1'),
  planId?: string(name='PlanId', example='6c5a397bc17c4b48ace86f0f0c30****'),
  templateId?: string(name='TemplateId', example='36f06322442e4e3f85a5ae8862c9****'),
}

model UpdateRecordPlanResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error.'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model UpdateRecordPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRecordPlanResponseBody(name='body'),
}

async function updateRecordPlanWithOptions(request: UpdateRecordPlanRequest, runtime: Util.RuntimeOptions): UpdateRecordPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRecordPlan',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRecordPlan(request: UpdateRecordPlanRequest): UpdateRecordPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRecordPlanWithOptions(request, runtime);
}

model UpdateRtmpKeyRequest {
  deviceName?: string(name='DeviceName'),
  iotId?: string(name='IotId'),
  iotInstanceId?: string(name='IotInstanceId'),
  productKey?: string(name='ProductKey'),
  pullAuthKey?: string(name='PullAuthKey'),
  pullKeyExpireTime?: int32(name='PullKeyExpireTime'),
  pushAuthKey?: string(name='PushAuthKey'),
  pushKeyExpireTime?: int32(name='PushKeyExpireTime'),
}

model UpdateRtmpKeyResponseBody = {
  code?: string(name='Code'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateRtmpKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRtmpKeyResponseBody(name='body'),
}

async function updateRtmpKeyWithOptions(request: UpdateRtmpKeyRequest, runtime: Util.RuntimeOptions): UpdateRtmpKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceName)) {
    query['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.pullAuthKey)) {
    query['PullAuthKey'] = request.pullAuthKey;
  }
  if (!Util.isUnset(request.pullKeyExpireTime)) {
    query['PullKeyExpireTime'] = request.pullKeyExpireTime;
  }
  if (!Util.isUnset(request.pushAuthKey)) {
    query['PushAuthKey'] = request.pushAuthKey;
  }
  if (!Util.isUnset(request.pushKeyExpireTime)) {
    query['PushKeyExpireTime'] = request.pushKeyExpireTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRtmpKey',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRtmpKey(request: UpdateRtmpKeyRequest): UpdateRtmpKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRtmpKeyWithOptions(request, runtime);
}

model UpdateTimeTemplateRequest {
  allDay?: int32(name='AllDay', example='0'),
  name?: string(name='Name', example='test'),
  templateId?: string(name='TemplateId', example='fc82774fa749485bad7d719f9670****'),
  timeSections?: [ 
    {
      begin?: int32(name='Begin', example='20000'),
      dayOfWeek?: int32(name='DayOfWeek', example='0'),
      end?: int32(name='End', example='60000'),
    }
  ](name='TimeSections'),
}

model UpdateTimeTemplateResponseBody = {
  code?: string(name='Code', example='200'),
  errorMessage?: string(name='ErrorMessage', example='tenant auth error'),
  requestId?: string(name='RequestId', example='06DC77A0-4622-42DB-9EE0-25FIOHS82JK1'),
  success?: boolean(name='Success', example='true'),
}

model UpdateTimeTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTimeTemplateResponseBody(name='body'),
}

async function updateTimeTemplateWithOptions(request: UpdateTimeTemplateRequest, runtime: Util.RuntimeOptions): UpdateTimeTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allDay)) {
    query['AllDay'] = request.allDay;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.timeSections)) {
    query['TimeSections'] = request.timeSections;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTimeTemplate',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateTimeTemplate(request: UpdateTimeTemplateRequest): UpdateTimeTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTimeTemplateWithOptions(request, runtime);
}

